JSTL currently has 3 versions: JSTL1.0, JSTL1.1, JSTL1.2
JSTL1.0 and JSTL1.1 contain 2 jar packages of Jstl.jar and Standard.jar , which are required to refer to these 2 jar packages separately in the j2ee4 version.
JSTL1.2 in the J2ee5 jar is Jstl-1.2.jar, in J2ee6 is Jstl-imp.jar.
Variations for each version:
The servlet and JSP specifications supported by JSTL1.0 (EL), JSTL 1.1, and JSTL 1.2 are also different:
In Web. XML, declare the corresponding servlet version:
jstl1.2 needs servlet2.5 < web-app xmlns version =" 2.5 " Span style= "color: #ff0000;" > xmlns:xsi = "Http://www.w3.org/2001/XMLSchema-instance" xsi:schemalocation = "Http://java.sun.com/xml/ns/javaee http://java.sun.com /xml/ns/javaee/web-app_2_5.xsd " >
jstl1.1 and JSP2.0 need servlet2.4 < Span style= "color: #800000;" >web-app xmlns xmlns:xsi ="/http Www.w3.org/2001/XMLSchema-instance " version = "2.4" Xsi:schemalocation = "Http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4. xsd " >
JSTL1.0 and JSP1.2 need servlet2.3 < xmlns= "Http://java.sun.com/xml/ns/j2ee" xmlns:xsi= "http://www.w3.org/ 2001/xmlschema-instance " version=" 2.3 " xsi:schemalocation="/http/ JAVA.SUN.COM/XML/NS/J2EE http://java.sun.com/xml/ns/j2ee/web-app_2_3. xsd ">
How to refer to Taglib in JSP:
JSTL1.0 is used in the following ways:<%@ taglibURI= "Http://java.sun.com/jstl/core"prefix= "C" %>JSTL1.1 is used in the following ways:<%@ taglibURI= "Http://java.sun.com/jsp/jstl/core"prefix= "C" %>The JSTL1.2 method is used for<%@ taglibURI= "Http://java.sun.com/jsp/jstl/core"prefix= "C" %>
Support for El Expressions:
Support for El expressions supported by default is:
1, servlet2.4
2, J2ee6
El expressions are not supported by default and require one of the following 2 configurations to turn on EL:
1, add in the JSP:
<% @ Page iselignored = " false " %>
2. Add in WEB.XM:
<Jsp-config> <Jsp-property-group> <Url-pattern>*.jsp</Url-pattern> <el-ignored>False</el-ignored> </Jsp-property-group> </Jsp-config>
The final conclusion: if the new project recommends the use of J2ee6, because the new project cannot also use servlet2.4.