This week's book giveaway is in the HTML Pages with CSS and JavaScript forum.
We're giving away four copies of React Cookbook: Recipes for Mastering the React Framework and have David Griffiths & Dawn Griffiths on-line!
See this thread for details.
Win a copy of React Cookbook: Recipes for Mastering the React Framework this week in the HTML Pages with CSS and JavaScript forum!
  • 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
  • Ron McLeod
  • Paul Clapham
  • Rob Spoor
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Holloway
  • Piet Souris
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Frits Walraven
  • Himai Minh

EPractice Lab reivew exam 1 ,about the directory of tag files

 
Bartender
Posts: 2113
13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


Which of the following values of tagdir attribute of the taglib directive is invalid?
a. /WEB-INF/tags.
b. /META-INF/tags
c. /WEB-INF/tags/mytagidr
d./WEB-INF/custom-tags
Given answer is B.
The tagdir attribute is used to specify the directory where the tag extensions are installed.The valid values are
/WEB-INF/tags or any of its subdirectory.If any other value is given, a compilation error will occur.



I think d is invalid too. Tag files must be in /WEB-INF/tags or subdirectory in the web application. If it is in a jar file, it must be in /META-INF/tags.
If the tag file is within a jar file, it can only be refered by uri attribute, not tagdir attribute.

Reference:
https://coderanch.com/t/601954/java-Web-Component-OCEJWCD/certification/understand-tagdir-attribute-taglib-directive


1) Tag File is located in /WEB-INF/tags/ or one of its subdirectories
2) Tag File is located in /WEB-INF/lib/ in a Jar file and then inside the Jar file in a directory /META-INF/tags or one of its subdirectories

An URI can only be used if your are trying to access a Tag-file that is located in the Jar-file. The TLD will then tell the container where to find the Tag-file.
If you are using a Tag file located in /WEB-INF/tags (and the tagdir attribute in the JSP) the container will generate a TLD that will point to the Tag file, making the two possibilities almost equal.


https://coderanch.com/t/178207/java-Web-Component-OCEJWCD/certification/taglib-directive-tagdir-uri


The tag files *.tag must reside in jar-file/META-INF/tags or subdir of it and
a tld file must exist in jar-file/META-INF or subdir of it with <uri>someURI</uri> tag in it .


Based on the above two posts, b is not valid. We cannot use tagdir="/META-INF/tags" to refer to a tag file in a jar.
 
Creator of Enthuware JWS+ V6
Posts: 3395
312
Android Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I agree with you. Nice explanation!
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic