• 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

about taglib

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
in servlet2.3 specification it's said taglib-uri is "The taglib-uri element describes a URI, relative to the location of the web.xml document, identifying a Tag Library used in the Web Application
".
in book SCWCD Exam Study kit,it's said taglib-uri is "This is the user-defined URI. Its value can be an absolute URI, a root-relative URI, or a non-root relative URI." and I test this in below and it correct.
web.xml
<taglib>
<taglib-uri>http://www.google.com</taglib-uri>;
<taglib-location>/WEB-INF/test.tld<taglib-location/>
<taglib>
test.jsp
<%@taglib uri="http://www.google.com" prefix="test"%>
then i can use the <test:XXX>... custom tag.
the taglib-uri is not relative to the location of the web.xml document,is this meaning the servlet2.3 specification is error ?
 
sharp shooter, and author
Posts: 1913
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Effectively, the taglib-uri is just a string that uniquely identifies it. It doesn't really have any relevance to the web.xml file, even if you use a relative uri.
HTH
Simon
 
Liu Gang
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks for you reply.
and as what you said,,the taglib-uri is just exactly match the item of uri in jsp file
<%@ taglib uri="taglib-uri in web.xml" prefic="test"%>.
it's not relative to the location of the web.xml.
BTW,I have read your book of "Professional JSP Tag Libraries", only the trial readings, but it's great! --you know, I'm in Beijing, no paper book of "Professional JSP Tag Libraries" here, but have paper book "Professional Java Servlets 2.3" and "Professional JSP 2nd Edition",these two book translated in Chinese. They are all great,thank you! It's made me clearly about servlet, jsp,and some point of taglib,and It's help me passed the SCWCD(93%),thank you.
 
Simon Brown
sharp shooter, and author
Posts: 1913
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Liu Gang:
...these two book translated in Chinese.


Wow - they translated the books into Chinese? I didn't even know that Wrox did this.
Thanks for the great feedback.
Simon
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic