File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes problem opening taglib tld Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Make it so: Java DB Connections & Transactions this week in the JDBC forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "problem opening taglib tld" Watch "problem opening taglib tld" New topic

problem opening taglib tld

Cameron Park
Ranch Hand

Joined: Apr 06, 2001
Posts: 371
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

Joined: Jun 25, 2001
Posts: 17282

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.

An IDE is no substitute for an Intelligent Developer.
Cameron Park
Ranch Hand

Joined: Apr 06, 2001
Posts: 371
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

Joined: Nov 22, 2001
Posts: 5
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 ?
Wei Shung
I agree. Here's the link:
subject: problem opening taglib tld
It's not a secret anymore!