Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

tld inside a jar linked by web.xml

 
Elier Rguez
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I know I can link directly from a jsp to a tld located in a jar by uri tag, without using the web.xml file. But I have done a test using the web.xml and it doesn't work.

page.jsp


web.xml



taglibJarExample.jar/META-INF/taglibJar.tld


Error: Unable to read TLD "META-INF/taglib.tld" from JAR file

Why is looking for taglib.tld and not for taglibJar.tld?
If I rename taglibWithinJar.tld to taglib.tld and edit the web.xml, as following, it works fine. Any explanation?

web.xml


Thanks,
 
Ankit Garg
Sheriff
Posts: 9597
36
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The URI has nothing to do with the name of the tld file:

In this case, the container will not look for taglibJarExample.jar/META-INF/anyrandomstring.tld. Inside a jar, the name of the tld should always be taglib.tld. You can check this documentation on this...
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!