Solving “According to TLD or attribute directive in tag file” issue

Yesterday while working on one of the old web application that was created in J2EE / JSP which is using JSTL for painting pages, I encountered a wired issue. As I was using JSTL in my JSPs, I had include required jars like standard.jar and jstl.jar with proper version in classpath of my project. Still I was getting this error whenever I tried running JSP:

According to TLD or attribute directive in tag file, attribute value does not accept any expressions.

After digging into the issue and searching through web, finally I got a workaround to solve this issue. The taglib directive we use to include JSTL core in our JSP needs to be modified.

The taglib in my JSP was:

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

I changed above to:

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

And it worked for me!!!

I dig into standard.jar for any clue and also checked few .tld files in this jar but couldn’t find an explanation for this.
Any idea why this is so?



Tags: , ,

6 Comments

  • Amelio wrote on 22 February, 2010, 8:19

    Good article,

    I am using struts2-jquery-plugin-1.8.0 with acegi-security-1.0.7

    Thank you so much

    good bye

    • Viral Patel wrote on 23 February, 2010, 15:50

      @Amelio: Thanks for the comment

  • Lalitha wrote on 13 January, 2011, 8:16

    Thanks a lot for the advice. It really worked and it has taken so long for me to get to know this. Thanks again

  • julie wrote on 22 September, 2011, 14:26

    Thanxxxxxxxxxxx..a lot..it really worked

  • Vijay Singh Chandel wrote on 8 December, 2011, 14:16

    great It worked …thanks If u could also specify what was the issue earlier ….?

  • Buminda wrote on 9 January, 2012, 9:33

    Yes , this worked for me , thanks for the post.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

Copyright © 2012 ViralPatel.net. All rights reserved.