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.
Reason for this error is version incompatibility between JSP, Servlet and JSTL. Matching versions are listed below.
Check the web.xml to see whether it uses the Servlet 2.3 DTD or Servlet 2.4 Schema.
If it uses Servlet 2.3 DTD, it will have the following text.
For Servlet 2.4 Schema, it will look like below.
When you change the versions correctly, no such errors will pop-up. Hope this will help you.
Reason for this error is version incompatibility between JSP, Servlet and JSTL. Matching versions are listed below.
- JSP 1.2 , Servlet 2.3 , JSTL 1.0
- JSP 2.0 , Servlet 2.4 , JSTL 1.1
Check the web.xml to see whether it uses the Servlet 2.3 DTD or Servlet 2.4 Schema.
If it uses Servlet 2.3 DTD, it will have the following text.
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
.....
</web-app>
For Servlet 2.4 Schema, it will look like below.
<web-app version="2.4"
xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
.....
</web-app>
When you change the versions correctly, no such errors will pop-up. Hope this will help you.
Kamal Mettananada is a software engineer, Java explorer & author of Digizol, blog with computer related articles, tutorials, tips and many other information.
17 Comments for "[JSTL] According to TLD or attribute directive in tag file, attribute items does not accept any expressions"
I had the same issue, and on google, your post popped up first. It did not work using your solution, but i found out the same problem appears when the old jstl Taglib url is used.
I replaced
<%@taglib uri="http://java.sun.com/jstl/core" prefix="c"%>
with
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
which solved my problem.
Thanks, I had the same issue and it's solved by changing the Servlet version from 2.4 to 2.3
thank you very much !
Thanks Timo
Jiri
It worked for me :)
thank you very much !
thanks
I replaced <%@taglib uri="http://java.sun.com/jstl/core" prefix="c"%>
with
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> and with
<%@taglib uri="http://java.sun.com/jsp/jstl/core_rt" prefix="c"%>.
But my problem wasn't solved.
Please someone help me.