Setup Jstl For Jsp 2 (Wiki forum at Coderanch) (original) (raw)
Servlets 2.5, JSP 2.1, JSTL 1.2
- Make sure that your container is Servlets 2.5 and JSP 2.1 capable. For Tomcat that's version 6.
- Be sure that your web.xml is properly configured for Servlets 2.5 as described in ServletsWebXml.
- Download the JSTL 1.2 jar files. A link to the Sun implementation is available in JstlTagLibDefinitions.
- Place the jars in the WEB-INF/lib folder of your web application, or to share them among all apps whatever folder your container uses for such sharing. For Tomcat 6 that would be $CATALINA_HOME/lib. (Please note that sharing these jars across different applications in the same container causes many issues. Because of that it's advised to use them inside the WEB-INF/lib folder of the web application).
- In your JSPs be sure to declare the taglibs using the proper URIs. See list below.
- If you have a JSP prelude declared in your web.xml, that's a great place to put the taglib declarations as opposed to declaring them on each page.
JSTL 1.2 URIs:
Servlets 2.4, JSP 2.0, JSTL 1.1
- Make sure that your container is Servlets 2.4 and JSP 2.0 capable. For Tomcat that's version 5.0 or 5.5, and for Resin it's version 3.0. JBoss uses Tomcat so check which Tomcat version your JBoss installation is using.
- Be sure that your web.xml is properly configured for Servlets 2.4 as described in ServletsWebXml.
- Download the JSTL 1.1 jar files. There are two: jstl.jar and standard.jar. You need both! Links available in JstlTagLibDefinitions.
- Place the jars in the WEB-INF/lib folder of your web application, or to share them among all apps whatever folder your container uses for such sharing. For Tomcat 5.5 that would be $CATALINA_HOME/shared/lib. (Please note that sharing these jars across different applications in the same container causes many issues. Because of that it's advised to use them inside the WEB-INF/lib folder of the web application).
- In your JSPs be sure to declare the taglibs using the proper URIs. See list below. Note that the URIs for JSTL 1.0 and JSTL 1.1 are different. Don't confuse them!
- If you have a JSP prelude declared in your web.xml, that's a great place to put the taglib declarations as opposed to declaring them on each page.
JSTL 1.1 URIs: