Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem opening taglib tld

 
Cameron Park
Ranch Hand
Posts: 371
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a question about tag library descriptor. I specified in my JSP a URI for the taglibrary descriptor as "/hello". And I placed the tld file in Web-inf directory. The question is when I tried to open the JSP. Tomcat says can not open library descriptor "C:\tomcat\webapp\thisWebApp\hello" I don't know why tomcat doesn't recognize the taglib's uri and trace to the proper tld file but instead taking the uri somehow as a file and could not open it!
Thanks for your help.
 
Tim Holloway
Saloon Keeper
Posts: 18304
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Despite its name, I'm not sure that that's a true URI, but actually a path. The usual approach would be to put your TLD in the WEB-INF directory (which isn't usually URL-accessible) and code the taglib definition like this:
<%@ taglib uri="/WEB-INF/hello.tld" prefix="hi" %>
That's from memory, so it may be a little garbled. You may want to RTFM just to make sure.
 
Cameron Park
Ranch Hand
Posts: 371
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What if I specified the uri path to the tld in a web.xml, and then used that uri in my taglib directive?
 
wei shung chung
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have the same problem. Look at my error message....
==========================================
org.apache.jasper.compiler.CompileException: /www/codejuice/webapps/onjava/welcome2.jsp(0,0) Unable to open taglibrary /WEB-INF/onjavataglib2.tld :
Parse Error in the tag library descriptor: External parameter entity "%[dtd];" has characters after markup.
============================================
Have you found the solution ?
Thanks.
Wei Shung
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic