This week's book giveaway is in the Java in General forum.
We're giving away four copies of Java by Comparison (eBook) and have Simon Harrer, Jörg Lenhard, Linus Dietz on-line!
See this thread for details.
Win a copy of Java by Comparison (eBook) this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Epractice Lab quiz 1 about tags file's directory  RSS feed

 
Ranch Hand
Posts: 1639
10
  • Mark post as helpful
  • send pies
  • 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/mytagdir
d. /WEB-INF/custom-tags

Explanation:
Choice B is correct


The "tagdir" attribute is used to specify the directory where the tag extensions are installed.
The valid values are /WEB-INF/tags/ directory or any of its subdirectory.
If any other value is given, a compilation error will occur. Thus, choices A and C are valid and hence incorrect.


I think d is also invalid.
 
Creator of Enthuware JWS+ V6
Bartender
Posts: 3086
255
Android Chrome Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I think d is also invalid.



Not according to the JSP 2.x specifications:

JSP.1.10.2 The taglib Directive

tagdir - Indicates this prefix is to be used to identify tag extensions installed in the /WEB-INF/tags/ directory or a subdirectory. An implicit tag library descriptor is used (see Section JSP.8.4 for details). A translation error must occur if the value does not start with /WEB-INF/tags/. A translation error must occur if the value does not point to a directory that exists. A translation error must occur if used in conjunction with the uri attribute.

 
Himai Minh
Ranch Hand
Posts: 1639
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Fritz,
In HF book, it say tag files have to be in /WEB-INF/tags or subdirectory of it.

So, putting a tag file under other directory is not considered as a tag file.
 
Frits Walraven
Creator of Enthuware JWS+ V6
Bartender
Posts: 3086
255
Android Chrome Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, you are right (I didn't see invalid in the problem statement).

Option b and d are correct.
 
These are not the droids you are looking for. Perhaps I can interest you in a tiny ad?
Thread Boost - a very different sort of advertising
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!