• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Unable to read TLD when accessing a JSP

 
Ranch Hand
Posts: 188
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a JSP which is using two of the standard tag libraries.

I have the JSTL files standard.jar and jstl.jar in my web application's /WEB-INF/lib directory. Still it seems that the TLD being sought by Tomcat (META-INF/c.tld) isn't being read correctly, even though it is contained in the /WEB-INF/lib/standard.jar file. Here is the exception message I am getting when I try accessing the page:




Here is my JSP:




I have the following taglib entries in my web.xml:





Can anyone see what I have done wrong, or what else I need to do in order to have the TLD read correctly for the JSTL tags ?

I am using Tomcat 5.5.4.

Thanks in advance for any suggestions.


--James
 
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Looks like it's your entries in web.xml. They need to point to the tld files, not the .jar files. For example:

<taglib>
<taglib-uri>http://java.sun.com/jstl/core</taglib-uri>;
<taglib-location>/WEB-INF/tags/c.tld</taglib-location>
</taglib>

That's if your tld files are in a directory called "tags" under the WEB-INF directory. Some people call this directory "tld". Call it what you want, but the tld files have to exist and that's what you want in your web.xml entries for tag libraries.
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You should remove the web.xml entires entirely and let Tomcat auto-discover the TLDs.
 
M. Gagnon
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Bear Bibeault:
You should remove the web.xml entires entirely and let Tomcat auto-discover the TLDs.



Oo, can I give that a try, too? Didn't know it was possible!
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Tomcat will search through the jars in its classpath looking for TLD files that match a given URI.
 
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Just check if ur JAVA_HOME points to jdk1.4 . The problem might have been caused cos u used jdk1.3 (I got the same error when I did that)
Thanks
Dhanya
 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
do NOT package javax.servlet.jsp.jar with your webapp, it confuses tomcat :P

We were getting the exact same error, removing javax.servlet.jsp.jar from the WEB-INF/lib sorted it
[ April 10, 2008: Message edited by: Balmark ]
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"Balmark",
Please check your private messages.
-Ben
 
Every time you till, you lose 30% of your organic matter. But this tiny ad is durable:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic