Showing posts with label JSTL. Show all posts
Showing posts with label JSTL. Show all posts

Attribute items does not accept any expressions.

Error Message
According to TLD or attribute directive in tag file, attribute items does not accept any expressions. When working on a J2EE (Java Enterprise Edition) web application
with JSTL (JSP Standard Tag Library), this is a pretty common error.



Click here to View more...

Jstl Tag Lib Definitions v1.0 v1.1 v1.2

JSTL 1.2 (J2EE 5/JSP 2.1) Download: https://jstl.dev.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://jakarta.apache.org/site/downloads/downloads_taglibs-standard.cgi

<%@ 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://jakarta.apache.org/site/downloads/downloads_taglibs-standard-1.0.cgi
<%@ 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.



main


Click here to View more...