File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes Not being able to locate TLD file? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » JSP
Bookmark "Not being able to locate TLD file?" Watch "Not being able to locate TLD file?" New topic
Author

Not being able to locate TLD file?

Arvind Mahendra
Ranch Hand

Joined: Jul 14, 2007
Posts: 1162
I am trying to run an example on Ch7 of JavaServerPages 3rd ed. by Hans Bergsten.
My TLD file resides inside the WEB-INF folder called taglib.tld
My TLD looks like



this is what the beginning 2 lines of my message.jsp look like:


The error message I get in Tomcat is;

NOTE: I HAVE NOT YET CREATED A WEB.XML file. could this be the cause of this? in the dos prompt it says:
WARNING: Internal Error: File /WEB-INF/web.xml not found
[ October 08, 2007: Message edited by: Chunnard Singh ]

I want to be like marc
paritosh ranjan
Ranch Hand

Joined: Aug 24, 2007
Posts: 62
You are specifying URI in the tld file.So,mapping URI to a tld is not necessary if the URI is specified in the taglib and the tld is inside a jar file.So,if this tld is inside a jar file then the JSP engine will find it automatically;However,if the tld file is not in a jar file,then you will have to map the URI to a tld file in web.xml.
paritosh ranjan
Ranch Hand

Joined: Aug 24, 2007
Posts: 62
If you still have some doubts then read "explicit mapping","implicit mapping" and "well known URI's",i hope this will clear out the doubts on this topic.
Arvind Mahendra
Ranch Hand

Joined: Jul 14, 2007
Posts: 1162
Hi paritosh. I was thinking the same thing that I had to add an entry in web.xml however the web.xml given by the author is as follows nowhere does it have an entry for the TLD file.

I will read the docs you have suggested. where can I find them?
paritosh ranjan
Ranch Hand

Joined: Aug 24, 2007
Posts: 62

JSP.7.3.9 Well-Known URIs

A JSP container may �know of� some specific URIs and may provide alternate
implementations for the tag libraries described by these URIs, but the user must see
the behavior as that described by the required, portable tag library description
described by the URI.
A JSP container must always use the mapping specified for a URI in the
web.xml deployment descriptor if present. If the deployer wants to use the
platform-specific implementation of the well-known URI, the mapping for that
URI should be removed at deployment time.


I am not sure but the tld you are using looks like a well known uri i.e. URI which is already known to the container.

So,the mapping might not be needed as the container already knows about the well known uri's.

I read that mapping stuff in a book on scwcd by Hanumant Deshmukh.
 
GeeCON Prague 2014
 
subject: Not being able to locate TLD file?