jstl

how does jsp:useBean scope attribute work?

℡╲_俬逩灬. 提交于 2021-01-29 03:25:23
问题 I am trying to understand how exactly scope attribute in jsp:useBean JSP action tag works. In my understanding scope is used to indicate where the bean is located (request,session,application etc.), but after some testing I came across an interesting situation where it's not the case, please consider the following JSP code (I am using scriplets here just for the sake of simplicity): <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1" import=

jsp jstl sql strange behaviour with as in mysql

北城以北 提交于 2021-01-27 06:51:55
问题 In mysql i m having a stored procedure which has a sql like: select firstname as i_firstname , lastname as i_lastname from roleuser where user_id = uid ; I m using a jstl code to get the values: - <sql:query var="comm_codes" dataSource="jdbc/myDatasource"> call sp_select_username(?); <sql:param>${user_id}</sql:param> </sql:query> <c:forEach var="rows" items="${comm_codes.rows}"> ${rows.i_firstname} ${rows.i_lastname} </c:forEach> But this code does not return anything but when the replace the

jsp jstl sql strange behaviour with as in mysql

你离开我真会死。 提交于 2021-01-27 06:51:06
问题 In mysql i m having a stored procedure which has a sql like: select firstname as i_firstname , lastname as i_lastname from roleuser where user_id = uid ; I m using a jstl code to get the values: - <sql:query var="comm_codes" dataSource="jdbc/myDatasource"> call sp_select_username(?); <sql:param>${user_id}</sql:param> </sql:query> <c:forEach var="rows" items="${comm_codes.rows}"> ${rows.i_firstname} ${rows.i_lastname} </c:forEach> But this code does not return anything but when the replace the

湖南大学JavaEE期末整理(二)——第四、五、六章

故事扮演 提交于 2021-01-19 14:34:32
清单为复习课时老师说的重点,高亮部分为PPT上标明“考”的部分。全部整理自PPT,仅供参考。 JavaEE重点清单(接一) JDBC PreparedStatement EL表达式 JSTL 概念选择题 Hibernate 四、JDBC JDBC驱动程序的类型 JDBC-ODBC桥驱动程序及OCBC驱动程序 本地API部分Java驱动程序 JDBC-Net纯Java驱动程序 本地协议纯Java驱动程序 接口名 说明 DriverManager 加载和卸载各种驱动程序并建立与数据库的连接 Connection 与数据的连接 PreparedStatement 执行预编译的SQL语句 ResultSet 查询出来的数据库数据结果集 Statement 执行SQL语句并将数据检索到ResultSet中 PreparedStatement PreparedStatement执行预编译的sql语句,支持参数化查询,使用setShort,setString等方法为参数赋值,如参数的SQL类型为INTEGER,则用setInt方法。 优点 写法参数化,如 String sql = "insert into user(username,password) values(?,?)"; 比Statement更快。性能更优,因为其已预编译在数据库系统中,参数化sql也不是字符串追加。

基于springboot2的开源OA办公系统

心已入冬 提交于 2021-01-06 01:10:42
Active4j-oa是基于 active4j-jsp 快速开发框架构建而来的OA办公系统。基于springboot2.0,以Spring Framework为核心容器,Spring MVC为模型视图控制器,Mybatis Plus为数据访问层, Apache Shiro为权限授权层, Redis为分布式缓存,Quartz为分布式集群调度,JSP作为前端页面引擎,采用JSTL标签库封装组件的开源框架。 项目介绍 Active4j-oa是基于 active4j-jsp 快速开发框架构建而来的OA办公系统。基于springboot2.0,以Spring Framework为核心容器,Spring MVC为模型视图控制器,Mybatis Plus为数据访问层, Apache Shiro为权限授权层, Redis为分布式缓存,Quartz为分布式集群调度,JSP作为前端页面引擎,采用JSTL标签库封装组件的开源框架。 Active4j-oa目前内置了绝大部分常见办公系统功能,包括系统管理,工作流管理,个人办公,人力资源管理,执行力管理等几大模块。开发者只需根据具体业务需求,稍加改进,就可以开发出一套完整的OA办公系统。 技术文档 讨论加群:qq群①:203802692 qq群②:773872959 演示地址: http://www.active4j.com:9005/oa 官方网站:

Can I use a jsp tag to hide an input field on load

泪湿孤枕 提交于 2020-12-06 04:03:03
问题 I need to hide a field on page load based on the value of a request attribute. I don't want a 'hidden' field because I want to show it again. I don't want to do this with javascript. How is this done with jsp tags? 回答1: Set a condition where display is block if the condition is true. Else if the condition is false set the display to none. <c:set var="inputDisplay" value="1" /> <!-- This same as your request attribute --> <c:choose> <c:when test="${inputDisplay == 1}"> <input type="text" /> <

Can I use a jsp tag to hide an input field on load

笑着哭i 提交于 2020-12-06 04:01:50
问题 I need to hide a field on page load based on the value of a request attribute. I don't want a 'hidden' field because I want to show it again. I don't want to do this with javascript. How is this done with jsp tags? 回答1: Set a condition where display is block if the condition is true. Else if the condition is false set the display to none. <c:set var="inputDisplay" value="1" /> <!-- This same as your request attribute --> <c:choose> <c:when test="${inputDisplay == 1}"> <input type="text" /> <

Can I use a jsp tag to hide an input field on load

给你一囗甜甜゛ 提交于 2020-12-06 04:01:16
问题 I need to hide a field on page load based on the value of a request attribute. I don't want a 'hidden' field because I want to show it again. I don't want to do this with javascript. How is this done with jsp tags? 回答1: Set a condition where display is block if the condition is true. Else if the condition is false set the display to none. <c:set var="inputDisplay" value="1" /> <!-- This same as your request attribute --> <c:choose> <c:when test="${inputDisplay == 1}"> <input type="text" /> <

升级到tomcat8碰到的问题总结

本秂侑毒 提交于 2020-12-04 23:56:44
一.url中特殊字符问题 根据rfc规范,url中不允许有 |,{,}等特殊字符,但在实际生产中还是有些url有可能携带有这些字符,特别是|还是较为常见的。在tomcat升级到7以后,对url字符的检查都变严格了,如果出现这类字符,tomcat将直接返回400状态码。 后来有人对此提出了异义,见: https://bz.apache.org/bugzilla/show_bug.cgi?id=60594 经过一番讨价还价,tomcat的开发人员增加一项设置,允许配置在url可以出现的特殊字符,但也仅限于|,{,}三种,见:http://tomcat.apache.org/tomcat-8.0-doc/config/systemprops.html#Other 该项设置在以下版本的tomcat中有效: - 8.5.x for 8.5.12 onwards - 8.0.x for 8.0.42 onwards - 7.0.x for 7.0.76 onwards 二.jso语法兼容问题: 如果使用到了jsp,则语法方面需要配置一下兼容:在catalina.properties里面加上: org.apache.jasper.compiler.Parser.STRICT_QUOTE_ESCAPING=false org.apache.jasper.compiler.Parser.STRICT

Mybatis学习系列(三)动态SQL

和自甴很熟 提交于 2020-11-22 06:55:29
  在mapper配置文件中,有时需要根据查询条件选择不同的SQL语句,或者将一些使用频率高的SQL语句单独配置,在需要使用的地方引用。Mybatis的一个特性:动态SQL,来解决这个问题。 mybatis动态sql语句是基于OGNL表达式的,主要有以下几类: 1. if 语句 (简单的条件判断) 2. choose (when,otherwize) ,相当于java 语言中的 switch ,与 jstl 中的choose 很类似 3. trim (对包含的内容加上 prefix,或者 suffix 等,前缀,后缀) 4. where (主要是用来简化sql语句中where条件判断的,能智能的处理 and or ,不必担心多余导致语法错误)、 5. set (主要用于更新时) 6. foreach (在实现 mybatis in 语句查询时特别有用) if标签语句   if标签用来实现根据条件拼接sql语句,下面示例用来判断参数如果不为null,则拼接sql 示例: < select id ="ifTest" resultType ="com.sl.po.Product" > select * from products where < if test ="ProductName!=null" > name like #{ProductName} </ if > < if