• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How does JSP contaner retrieve a tag from tld

 
Ranch Hand
Posts: 371
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

prefix="examples"
Hope you meant to say prefix="example"
regds.
- satya
 
Cameron Park
Ranch Hand
Posts: 371
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 5040
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 371
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you so much.
reply
    Bookmark Topic Watch Topic
  • New Topic