Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

taglibs distributed in jars

 
Josh Gunnar
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If I have a tablib jar (acme.jar) with:
/com/acme/HelloTag.class
/META-INF/lib.tld
where lib.tld has an element:
<uri>/acmeTags</uri>
and the jar is placed in /WEB-INF/lib within my app, then is this library accessible in the JSP page by:
<%@taglib uri="/acmeTags" prefix="acme"%> ?
If an explicit mapping would be necessary in web.xml, the spec says that the location should point to the jar file, so would this be valid:
<taglib>
<taglib-uri>/sameAsJSPuri</taglib-uri>
<taglib-location>/lib/acme.jar</taglib-location>
</taglib>
?
Thanks,
Josh
 
james edwin
Ranch Hand
Posts: 393
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think yes.But i have never tried this.But the logic is we need to tell the JSP-Engine that for "xyz"(variable we will be using in jsp) pls refer to jar file.
Logically,we should map.
Hey man but what do u get if u map it and not map it.Have u tried this.
All the Best
 
R K Singh
Ranch Hand
Posts: 5384
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<uri> tag of tld file is useful only when we have .jar files.
As if I have not jar file then in web.xml tag <taglib-location> will have path of tld file.
So am i right that <uri> tag is used when we are going to make jar of the tags.
Correct me if I am wrong (CMIW)
TIA
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic