JavaRanch Home    
 
This page:         last edited 27 July 2011         What's Changed?         Edit

JSTL Taglib Definitions   

JSTL 1.2 (J2EE 5/JSP 2.1) Download: http://jstl.java.net/download.html

JSTL 1.2 consists of two files (jstl-impl-1.2.jar and jstl-api-1.2.jar) and is available for download at the above link. It should be used for JSP 2.1 containers such Tomcat 6.

Older Versions

Be aware that there are two jar files to the JSTL; generally named jstl.jar and standard.jar. You need both.

Be sure to use the appropriate version of the JSTL for your servlet container. JSTL 1.1 should used for JSP 2.0 containers such as Tomcat 5 and Resin 3, while JSTL 1.0 should be used for containers supporting JSP 1.n.

JSTL 1.1 (J2EE 1.4/JSP 2.0) Download: http://archive.apache.org/dist/jakarta/taglibs/standard/

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<%@ taglib prefix="x" uri="http://java.sun.com/jsp/jstl/xml" %>

<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>

<%@ taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql" %>

<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>

JSTL 1.0 (J2EE 1.3/JSP 1.2) Download: http://archive.apache.org/dist/jakarta/taglibs/standard-1.0/

<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>

<%@ taglib prefix="x" uri="http://java.sun.com/jstl/xml" %>

<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt" %>
 
<%@ taglib prefix="sql" uri="http://java.sun.com/jstl/sql" %>
Notes on Dynamic Attributes for JSTL Tags

Under JSTL1.1 and JSP2.0 you can use either scriplet expressions such as <%= expr %> or EL expressions like ${expr} for JSTL tag attributes that accept run-time expressions. Most attributes in JSTL tags are enabled for run-time expressions, the most prevalent exceptions being the var and scope attributes of tags that accept them.

This is because under JSP 2.0 the responsibility for evaluating the expressions lies with the container.

Under JSTL1.0 and JSP 1.2, the JSTL is responsible for EL expression evaulation and you need to choose whether you want to use ${expr} or <%= expr %> notations. This is why two version of each tag set are provided; for example the c library for EL expressions, and the c-rt library for use with scriptlet expressions.


JspFaq SetupJstlForJsp2

JavaRanchContact us — Copyright © 1998-2014 Paul Wheaton