• 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

taglib-uri

 
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can taglib-uri be relative when taglib-location refers to a jar file. can anybody give the clarification and reference.
 
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Mathew,
From Manning Book:
"taglib-uri is a user defined uri.Its value can be absolute uri, root-relative uri or non root-relative uri."
As far as I understood,
You can name the taglib-uri whatever you want in the web.xml. The taglib-location is all that matters.
the uri specified in the jsp file should be given the same name as the one specified in the taglib-uri.
The engine will look at the mapping for the uri in the web.xml.If the mapping for the uri is found, the corresponding taglib-location is seen and that value is considered to be the location of the tld file. It can specify either the tld file or the jar file that contains the tld file.
If no mapping is found, then it would try to resolve the location using the uri specified in the jsp file. If this uri is an absolute uri, it will give a translation time error.
I hope this is clear.
Correct me if I am wrong.
Good Luck!
 
Ranch Hand
Posts: 285
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Mathew
Just adding to what Raji has said, the JSP engine builds a taglib mapping from <taglib> mappings in the deployment descriptor, as well as <uri> mappings in any jar'd taglib descriptors. For taglib descriptors, the uri is specified in the <uri> tag, and the location is the physical location of the .tld file.
When the url is requested, and the engine fails to find a match in it's taglib map, then it tries to resolve the location based on the format of the requested url. If the requested url is absolute, however, then a compile-time error is thrown.
So...
The taglib uri can be anything you want, but if a match is not found, and the requested url was absolute, then an error is thrown.
Hope this helps, 'coz I've just read it back to myself and realised that I haven't added much value to what Raji has already said
 
reply
    Bookmark Topic Watch Topic
  • New Topic