File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes How does JSP contaner retrieve a tag from tld Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "How does JSP contaner retrieve a tag from tld" Watch "How does JSP contaner retrieve a tag from tld" New topic
Author

How does JSP contaner retrieve a tag from tld

Cameron Park
Ranch Hand

Joined: Apr 06, 2001
Posts: 371
Hi, I am confused about how does JSP Container retrieve a tag from a tld. The prefix attribute specifies which tag library will be invoked by the taglib uri, right?
For <%@ taglib uri="/hello" prefix="examples">,
<example:hello> will invoke a tag whose name is "hello" in the tag library "example" (at /hello)?
Thank you so very much.
Madhav Lakkapragada
Ranch Hand

Joined: Jun 03, 2000
Posts: 5040

prefix="examples"
Hope you meant to say prefix="example"
regds.
- satya

Take a Minute, Donate an Hour, Change a Life
http://www.ashanet.org/workanhour/2006/?r=Javaranch_ML&a=81
Cameron Park
Ranch Hand

Joined: Apr 06, 2001
Posts: 371
Thank you Satya! Yes, prefix="example". Is that how the JSP container find the right tag from the tag library "example", by <name/> element in the <tag/> in <taglib/>?
Madhav Lakkapragada
Ranch Hand

Joined: Jun 03, 2000
Posts: 5040

Yes. The way I understand this is as follows:
(Hopefully someone will correct me if I mis-state something)
Using the prefix example, it locates the
TLD file ( mind you, the URI can also be a jar file,
I tested it ). In the TLD file, it expects to find
the tagName (the part after the prefix specified in
the JSP, without the colon) under the Name
(as you mentioned) element of a tag element.
It it finds a matching tag/name it uses all
that tag classes and attributes.
While I have't tried, I am relatively confident that
you can use more than one tag libraries (TLD's) in a
JSP each of which has a unique prefix.
Hope this helps.
regds.
- satya
Cameron Park
Ranch Hand

Joined: Apr 06, 2001
Posts: 371
Thank you so much.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How does JSP contaner retrieve a tag from tld
 
Similar Threads
about taglib-uri
can somebody explain this with eg
JasperException with RSS and JSTL
mock exam question
mention tld file in jsp