JSTL 1.2.x is the latest version of JSTL. There are a few differences between this version and the previous JSTL 1.1.x version. The most important difference is that JSTL 1.2.x supports Unified EL (Expression Language) , where as JSTL 1.1.x supports only traditional EL. With Unified EL it becomes very easy to combine the EL in JSF (Java Server Faces) and the EL in JSTL. This guide shows you how to install JSTL 1.2.x properly or troubleshoot your existing JSTL installation. (from: http://hi.baidu.com/kelly_zsl/blog/item/e004562e4f3363331f3089a0.html)
2. 复制此jstl-1.2.jar到Web工程的WEB-INFO/lib目录,不需要任何其他的配置,就可以在JSP页面中使用jstl了.
3. 示例: 在页面中输出 1 到 10
pageEncoding="ISO-8859-1"%>
-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
Insert title hereEL只操作属性,所操作的类应该是JavaBean规范的,所操作的属性要有getter, setter.
${user.username}: 默认是从request(page)中取,如果request中没有名为username的对象则从session中取,session中没有则从application(servletContext)中取,如果没有取到任何值则不显示。
访问ArrayList的方式:
1. 放入request.setAttribute()或者session.setAttriute(),然后items="${users}"
用户名密码2. 使用JSP的赋值表达式 items="",这种方式也可以访问数组
用户名密码