Java News Tips Software
Java News Tips Software | Contact | Facebook | Twitter RSS

[JSTL] According to TLD or attribute directive in tag file, 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.

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.

Labels: ,


17 Comments

  1. Hello,

    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.
  2. Hi,

    Thanks, I had the same issue and it's solved by changing the Servlet version from 2.4 to 2.3
  3. Timo: I was experiencing the exact same thing, using your change solved my problem

    thank you very much !
  4. Anonymous Anonymous on April 07, 2010 4:33 PM  
    Hello,
    Thanks Timo
  5. Thanks @Timo. I had the same problem when using Servlet 3.0 Schema.
  6. Anonymous Anonymous on July 19, 2010 3:34 AM  
    Timo thank you. You are solved my problem also :)
  7. Thanks guys, this thread helped me ... much appreciated
  8. Thank you so much !
    Jiri
  9. Anonymous Anonymous on January 06, 2011 3:36 PM  
    Thanks Timo, i faced the same problem After reading this post problem was solved
  10. Anonymous Anonymous on January 12, 2011 12:55 PM  
    Thanks Timo, i have faced the same problem After reading your post problem was solved
  11. Anonymous Anonymous on June 06, 2011 12:17 AM  
    Thanks Timo, it worked for me too
  12. well done! super
  13. Anonymous Anonymous on July 11, 2011 12:37 PM  
    Thanks Timo!
    It worked for me :)
  14. Hi Timo, I was experiencing the exact same thing, using your change solved my problem

    thank you very much !
  15. Anonymous Anonymous on October 01, 2011 7:07 AM  
    @ Timo
    thanks
  16. Anonymous Anonymous on January 06, 2012 2:43 PM  
    @Timo is right!
  17. I have the same problem...
    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.
ABOUT AUTHOR
Page Views :
Email :
PREVIOUS ARTICLES
Select Month:
TOP
Free counter and web stats