• Post Reply Bookmark Topic Watch Topic
  • New Topic

Three flavors of taglib element.....DUH!!!

 
Madhav Lakkapragada
Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I just realized (yup, I am slow but) there are three flavors of taglib elements.
1. taglib element in the web-app of a DD
<taglib>:
<!ELEMENT taglib (taglib-uri, taglib-location)>
2. taglib element in the TLD
<taglib>:
<!ELEMENT taglib
(tlib-version, jsp-version, short-name, uri?, display-name?, small-icon?, large-icon?, description?, validator?, listener*, tag+)>
3. and Ofcourse the taglib directive of a JSP.
For what its worth.........
- satya
[ February 17, 2002: Message edited by: Madhav Lakkapragada ]
 
Mark Spritzler
ranger
Sheriff
Posts: 17309
11
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Makes me wish you could bring in the dtd's into the test room.
I have been trying to find patterns in the dtd to make it easier to learn. As in the servlet tag and the filter tags both have init-param elements with the same inner tags.
But those inconsistencies are a pain.
Mark
 
Terence Doyle
Ranch Hand
Posts: 328
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I've been goimg over this too ( just 5 days before my exam...)
I've worked it out like this:
Ive got 3 layers.
The bottom layer is the .tld file which has all the machinery and logic in it - the handler class files are listed here etc.
The middle layer is the web.xml file where I tell the container about the existence of the .tld file I only tell it a handy name <taglib-uri> and the exact location <taglib-location> so the applications running in the container can reference it easily.
The top layer is the JSP page. here I declare I want to use the taglib resource by mentioning its handy name and I assign a prefix to distinguish my super tags from those plain old standard tags
Now all I have to do in my jsp pages is call my prefix and tag and that call is passed down through those layers and things happen
Hope that helps,
Terry
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!