Bug 15169

Summary: Taglibs Example (1.0.2) is Missing URI in a TLD
Product: Taglibs Reporter: Tony LaPaso <tony>
Component: Standard TaglibAssignee: Tomcat Developers Mailing List <dev>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P3    
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   

Description Tony LaPaso 2002-12-09 04:57:30 UTC
I'm not sure of the correct "component" so I just guessed -- (Standard 
Taglib) . :)

This may be a minor point but I wanted to mention it. 

I downloaded v1.0.2 of the standard taglibs (JSTL).

Since Tomcat v4.1.12 is a JSP v1.2-complient container, I decided to remove
all the "<taglib>" elements from the "web.xml" file in the "standard-examples"
webapp that's distributed with Apache's JSTL. 

After removing the "<taglibs>" form "web.xml", everything still worked great
when I ran the "standard-examples" app -- except for a minor thing: I could no
longer display the source code of the JSP by clicking on the "screwdriver"
icon. I'm referring here to the "screwdriver" icon that is intended to display
the JSP source code containing the JSTL code. 

It turns out that the "jstl-examples.tld" does not have a "<uri>" element in
its "<tablib>". As a result, there is no way for Tomcat to map the
"/jstl-examples-taglib" URI in "ShowSource.jsp" to a TLD. 

Anyway, I thought maybe this should be fixed or at least people should know
about it. 

Thanks
Comment 1 Pierre Delisle 2002-12-15 16:04:17 UTC
Added <uri> definition in WEB-INF/jstl-examples.tld for
/jstl-examples-taglib.

However, please note that that the problem reported will still persist
with tomcat 4.x because of bug 14200. Hans Bergsten is working with
the JSP expert group to resolve this issue.

Unfortunately, TLD mapping is often source of great confusion.

For JSP 1.2, the simplest model is the following:
When creating a taglib:
  - define the <uri> element in the TLD
  - jar the taglib with the TLD in it

Then all a client webapp has to do is
  - drop the taglib jar file into WEB-INF/lib of the webapp
  - use the uri defined for the taglib in the <taglib> directive

With that model, no modification of the webapp's deployment
descriptor (web.xml) is required.

I've therefore modified web.xml to remove all the mappings
for the JSTL TLDs since they are not necessary, and simply adds
to the confusion. The mapping for jstl-examples has been
left in there for now because of bug 14200.

[One could argue that the taglib defined in the examples
webapp should also be built as a jar file. This should
definitely be the case if that taglib was to be reused 
outside of the examples web-app. But since this is not the case, 
we'll leave it as is (otherwise we'd have to create another
directory in standard, examples-taglib, that would specifically
host the code for the examples taglib...)]