aspose file tools*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes taglib-location value in web.xml Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "taglib-location value in web.xml" Watch "taglib-location value in web.xml" New topic
Author

taglib-location value in web.xml

raj malhotra
Ranch Hand

Joined: Feb 22, 2007
Posts: 285
Following is the quote from the jsp 1.2 spec about taglib-location

JSP.7.3.6.1 Computing TLD Locations
The taglib map generated in Sections JSP.7.3.3, JSP.7.3.4 and JSP.7.3.5 may
contain one or more <taglib></taglib> entries. Each entry is identified by a
TAGLIB_URI, which is the value of the <taglib-uri> subelement. This TAGLIB_URI may
be an absolute URI, or a relative URI spec starting with / or one not starting with
/. Each entry also defines a TAGLIB_LOCATION as follows:
1. If the <taglib-location> subelement is some relative URI specification that
starts with a / the TAGLIB_LOCATION is this URI.
2. If the <taglib-location> subelement is some relative URI specification that does
not start with /, the TAGLIB_LOCATION is the resolution of the URI relative to
/WEB-INF/web.xml (the result of this resolution is a relative URI specification
that starts with /).


But i am not clear with how it will be calculated and what are the valid values for taglib-location?Can anybody explain this?


Thanks,
Raj
Chinmaya Chowdary
Ranch Hand

Joined: Apr 21, 2008
Posts: 432
Hi, Raj.

In
1. If the <taglib-location> sub element is some relative URI specification that
starts with a / the TAGLIB_LOCATION is this URI.

instead of 'relative URI', I think it should be 'absolute URI'. Please correct me if my understanding is wrong. Since relative URI should not start with '/'.
Suppose if we placed our .tld file(myTld.tld) that is present in directory 'tlds', directly under web application root directory and if we define web.xml as
then container searches for .tld file from web application root directory. Here TAGLIB_LOCATION resolves to '/tlds/myTld.tld'.

In
2. If the <taglib-location> subelement is some relative URI specification that does
not start with /, the TAGLIB_LOCATION is the resolution of the URI relative to
/WEB-INF/web.xml (the result of this resolution is a relative URI specification
that starts with /).

Suppose if we placed our .tld file, 'myTld.tld' that is present in directory 'tlds' under WEB-INF like /WEB-INF/tlds/myTld.tld and if we made entry in web.xml as then container searches for tld file from WEB-INF folder. Then TAGLIB_LOCATION will resolve to '/WEB-INF/tlds/myTld.tld'.
raj malhotra
Ranch Hand

Joined: Feb 22, 2007
Posts: 285
HI Chinmaya

you are correct about the way container calculates the location.

Thanks,
Raj
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: taglib-location value in web.xml