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" %>
Code language: HTML, XML (xml)
I changed above to:
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %>
Code language: HTML, XML (xml)
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?
Get our Articles via Email. Enter your email address.

You may also like...

58 Comments

  1. Amelio says:

    Good article,

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

    Thank you so much

    good bye

    • @Amelio: Thanks for the comment

  2. Lalitha says:

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

  3. julie says:

    Thanxxxxxxxxxxx..a lot..it really worked

  4. Vijay Singh Chandel says:

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

  5. Buminda says:

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

  6. gopala says:

    thank you,its worked for me.so many blogs and many peoples written unnecesary things.but this one worked for me thank you

  7. Ravindra says:

    Thanks a lot, solved my problem

  8. Ronald says:

    Thank you for the post this really helped cause I was getting a terrible headache

  9. Tharakaram says:

    This is due to missing of under . This is used to specify the tag accepts EL expression to resolve value. By default its false. so if you want use dynamic EL
    expression for your attribute then you need to define tag value as ‘true’.

    Eg:–

    input
    true
    true

    • Abhilash Pulluri says:

      great It worked …thanks a lot

    • Smily face says:

      Thanks to vikram patel & Tharakaram

  10. Abhilash Pulluri says:

    this worked for me , thanks for the post.

  11. Jeshan Babooa says:

    Thanks for this. It helped me. as to why this is actually so, compare the following two fragments:

    before, we were using the tld (file: META-INF/fmt-1_0.tld) which had:

    bundle
    false
    false

    but now with “… _rt”, the attribute bundle is defined in META-INF/fmt-1_0-rt.tld as follows:

    bundle
    false
    true

  12. thanks a lot dude says:

    Thanks a lot dude :D

  13. santosh says:

    thank you so much.

  14. Ravi. B says:

    Very useful one. I tried lot others like changing the JSTL version from 1.2 to 1.0. After changing the directive it got worked. Thank you very much.

  15. Bob S. says:

    Thank you …
    I was stuck on this for over 2 hours. Your research saved the day.

  16. jitendra says:

    Thanks a lot . It helped me

  17. raj says:

    Thanks a lot

  18. Tebogo says:

    thank you so much, i will try research the reason this tag lib has to be extended to _rt.
    thank youuuuuuuuuuuuuuuuuuuuuuuu; you save a lot of us.

  19. shaharyar says:

    awesome man! brialliant :)

  20. Pradeep says:

    it has worked for me

  21. Phoenix says:

    Thanks a lot ! It has worked for me !

  22. Venu says:

    Brilliant! Worked like a charm.

  23. manu says:

    Thanks it really helped me!

  24. Jhon says:

    Great work…

  25. Fiyaz says:

    Grt …
    thnk u so much ….

  26. Rishank says:

    absolutely right and exact,,,,thanx a lot

  27. vijay says:

    great
    ————thnk u so much .It’s working

  28. Rashi.. says:

    Thanks a lot.. saved my time.. :)

  29. Henry says:

    Thanks buddy.Any way the rt stands for Runtime and it specifies that it should be ignored and executed at run time

  30. asfiya says:

    awesome it worked!!!!thanks

  31. Naki says:

    thank you so much

  32. ashish says:

    working fine .Gr8 job:)

  33. Samujeet says:

    Good article !!! Works nice in my J2EE project in netbeans 6.9.1 with JSTL i.e [] tag library.
    Thank U..

  34. vishal mulik says:

    It removes the error core_rt but still values not display on browser. I am suppose to return spring return new ModelAndView(“hello”, “now”, now); value on hello.jsp page using
    .
    runtime value not showing on browser.
    Would you please help me on this.
    Thanks in advance.

  35. fareed says:

    Thanks its worked

  36. Kartheek H says:

    Simple and great solution, thank you very much.

  37. Bhavika says:

    worked for me as well!! thanks a ton :)

  38. Pankaj says:

    Thank you are its working. i used it as

    In Active
    Active

    Thank you.

  39. Shishir says:

    It really worked…..but i was unable to get to the reason… :(

  40. vna says:

    worked for me.thanks a lot.

  41. pari says:

    Thank you for the post…it worked for me. :-)

  42. Balamurugan says:

    Hi
    Itz worked for me too!!!

  43. leoS says:

    Excellent solution. Just now I had this problem with Apache Tomcat 7.0.11 and was badly surprised of it, because under Tomcat 7.0.42 all goes right without “_rt”.

  44. Gregory says:

    http://www.coderanch.com/t/502093/JSP/java/difference-JSTL-taglib-core-rt 


    says “the two libraries differed in that one would allow run-time expressions as tag attribute values, and one wouldn’t.”

  45. Prasad says:

    Thanks this helped.

    I checked further on the TLD files in the JAR. The older version of TLD file has been renamed and if you look at the URI you should see it as

    http://java.sun.com/jstl/core_rt

    hope this helps

  46. thanks

  47. It worked Thanks for ur help

  48. Anton says:

    +1 yep,it works, thanks)

  49. Satyanarayan says:

    thanks a lot…

  50. pramod says:

    thanks a lot

  51. ravi kishore says:

    very thanks…

  52. rinku says:

    really vry nice

  53. pramod says:

    thanks…..

  54. hattori says:

    thanks dude, works for me

  55. Thamaraiselvam says:

    Thank you so much.It really worked

Leave a Reply

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