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

Taglib questions

 
Dumitru Husleag
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Q1: I am wondering what is the purpose of the taglib tag in web.xml
After all you can live without it. I mean to use a custom tag it is enough to use the taglib directive with a absolute uri like this
<%@ taglib uri="/WEB-INF/Sample.tld" prefix="S"%>
and it works.
So, can anybody tell me when to use <taglib> in web.xml ?
Q2: could you please state the right definition for the <uri> atribute of the taglib directive (absolute, relative: if relative then relative to what ?) ?
Also please state clearly the difference for the <taglib-uri> and <taglib-location> tags from the taglib tag from web.xml
Also please clear out <uri> tag from the .tld file.
And a last one: the specs confuses me because uses 'uri' like a 'url' when talking of 'relative uri' or 'absolute uri'.
[I am talking about JSP1.2 specs]
Thanx a lot
 
Dhaval
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Answer 1:- the only reason i think of using the tablib in web.xml is that it lets you map the <uri> to a particular location.

another thing is, the uri you posted is a relative uri not an absolute uri.

Absoulte uri:- e.g. http://hostname:8080/, A uri that has a protocol, a host name and an optional port number

relative uri :- e.g. /WEB-INF/helloLib/tabLib/helloLib :- Auri that starts with / without a protocol, hostname and a protocol is an relative uri. It is interpreted as relative to the document root of the web application.

<uri> tag in .tld file is same as the combination of <taglib-uri/> <tablib-location/> tags in the web.xml file. the <uri> tag in the tld file is called implicit mapping and the one in the web.xml is called explicit mapping

please correct me if i am wrong.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic