About Question enthuware.jwpv6.2.1053 :

All the posts and topics that contain only an error report will be moved here after the error is corrected. This is to ensure that when users view a question in ETS Viewer, the "Discuss" button will not indicate the presence of a discussion that adds no value to the question.

Moderators: Site Manager, fjwalraven

Post Reply
tori3852
Posts: 38
Joined: Wed Oct 31, 2012 2:53 am
Contact:

About Question enthuware.jwpv6.2.1053 :

Post by tori3852 »

The <taglib> tag comes directly under the web-app element and it is used to specify the mapping between the name that will be used in the JSP pages and the URI where the actual tag library descriptor (.tld file) is located.
.
It does not – its parent is jsp-config:

Code: Select all

<jsp-config>
     <taglib>
         <taglib-uri></taglib-uri>
         <taglib-location></taglib-location>
     </taglib>
 </jsp-config>

admin
Site Admin
Posts: 10065
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.jwpv6.2.1053 :

Post by admin »

You are right. It seems the old 2.4 dtd has it under web-app and in 3.0 it is under jsp-config.
This has now been fixed.
thank you for your feedback!
-Paul.
If you like our products and services, please help us by posting your review here.

tori3852
Posts: 38
Joined: Wed Oct 31, 2012 2:53 am
Contact:

Re: About Question enthuware.jwpv6.2.1053 :

Post by tori3852 »

Another small note about explanation
1. Make a jar file of all the classes and include *.tld files in META-INF directory inside the jar.
For consistency it should be mentioned that not only META-INF directory, but also its subdirectories (JSP 2.2 specification: JSP.7.3.1 Identifying Tag Library Descriptors):
When deployed inside a JAR file, the tag library descriptor files must be in the META-INF directory, or a subdirectory of it.
.

admin
Site Admin
Posts: 10065
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.jwpv6.2.1053 :

Post by admin »

This has now been fixed.
thank you for your feedback!
-Paul.
If you like our products and services, please help us by posting your review here.

harsh.sahajwani
Posts: 13
Joined: Sun Jan 20, 2013 5:58 am
Contact:

Re: About Question enthuware.jwpv6.2.1053 :

Post by harsh.sahajwani »

The correct option (option 2) states:

"specify the mapping of the name and the TLD file for a tag library."

The taglib element specifies a mapping between taglib-uri and a taglib-location. Why does this correct option states that it is a mapping between name and TLD file? Shouldn't it be changed to say:

"specify the mapping of the uri and the TLD file for a tag library."

admin
Site Admin
Posts: 10065
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.jwpv6.2.1053 :

Post by admin »

taglib-location can be used to specify the location of the tld file :

Code: Select all


<taglib>
 <taglib-uri>/mylibrary</taglib-uri>  ( You can use 'mylibrary' in the JSP taglib directive : <%@taglib uri="/mylibrary" prefix=="mylib"%> )
 <taglib-location>/WEB-INF/tlds/MYLibrary.tld</taglib-location> // This is the location of tld file for the tag library.
</taglib>
If you like our products and services, please help us by posting your review here.

harsh.sahajwani
Posts: 13
Joined: Sun Jan 20, 2013 5:58 am
Contact:

Re: About Question enthuware.jwpv6.2.1053 :

Post by harsh.sahajwani »

"name" should be changed to "uri" in the statement:

"specify the mapping of the name and the TLD file for a tag library."

It should be:

"specify the mapping of the uri and the TLD file for a tag library."

jmkenny
Posts: 8
Joined: Sun Jun 02, 2013 11:04 am
Contact:

Re: About Question enthuware.jwpv6.2.1053 :

Post by jmkenny »

I completely agree with the above post. "uri" is not "name" otherwise the taglib directive would have been <%@ taglib name="" prefix="" %> and deployement descriptor would use <taglib-name> instead of <taglib-uri>.

The correct option should be mapping between uri and TLD.

admin
Site Admin
Posts: 10065
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.jwpv6.2.1053 :

Post by admin »

This has now been fixed.

thank you for your feedback!
If you like our products and services, please help us by posting your review here.

JoeAllen
Posts: 13
Joined: Thu Jul 11, 2013 11:22 pm
Contact:

Re: About Question enthuware.jwpv6.2.1053 :

Post by JoeAllen »

The correct answer 2. still says, "specify the mapping of the name and the TLD file for a tag library.". I was confused by the name too. If it'd said,"specify the mapping of the uri and the location of TLD file for a tag library.", I'd have gotten it right. As a result, I picked 4. "specify the TLD file location.".

In your explanation:"Note that the mapping information contained within the tld file will always be loaded by the container. The <taglib> tag in web.xml is used to provide any additional taglib-uri mappings. And for those additional mappings, you will need to specify the taglib-location.", which sounds like tld files are looked in first before looking into DD.

But in HFSJ p485, it says,"when the Container begins to build the <uri>-to-TLD map, the Container will look first in your DD to see if you've made any <taglib> entries, and if you have, it'll use those to help construct the map.".

admin
Site Admin
Posts: 10065
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.jwpv6.2.1053 :

Post by admin »

You are right. This has now been fixed.
thank you for your feedback!
If you like our products and services, please help us by posting your review here.

Post Reply

Who is online

Users browsing this forum: No registered users and 64 guests