• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

implicit mapping - taglib ???

 
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Right now I'm studying for the exam and I've reached the topic:

associating URIs with TLD file locations: implicit mapping

I'm a bit confused on this one. What exactly is implicit mapping?
If you put the taglib.tld in a jar file and store this jar-file in the lib directory of your webapplication. Is that enough for the JSP engine to do a implicit mapping? Suppose the taglib.tld has an <uri> element like this : "http://www.someserver.com/abc"; and the JSP page contains:

<%@ taglib prefix="test" uri="http://www.someserver.com/abc"; %>
can the container based on this info make a implicit mapping? Do i need
to do also something with the web.xml in this case?

Another thing, suppose the web.xml contains:

<taglib-uri>http://www.someotherserver.com/xyz</taglib-uri>;
<taglib-location>myLib/test.jar</taglib-location>

Is this a case of implicit or explicit mapping?

As you can see I'm very confused on this subject so any help
would be appreciated, thanks!

Regards,
Rick
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"implicit mapping" simply means that you don't have to care about mapping a library to a uri.
If you put the library where the container can find it, that the container will do the mapping for you.
As you said, if you put the jar file (with a TLD in META-INF or subdirectory of it) in the lib directory,
the container will do the mapping. You won't have to touch web.xml.
Anything you put in web.xml is called "explicit".

All you'll have to do is to use the taglib directive in your jsp, using the uri provided in the tld which is inside the jar file.

Tlds don't have to be necessarily inside jar files. They could also be in the WEB-INF directory, or some subdirectory of it.

Refer to the spec, "JSP.7.3.1 Identifying Tag Library Descriptors", which gives clear explanation about it.
 
Rick Rangers
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Thanks for the reply! I understand it now, thanks!

Regards,
Rick
 
If you two don't stop this rough-housing somebody is going to end up crying. Sit down and read this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic