Which of the following values of tagdir attribute of the taglib directive is invalid?
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.
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.
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.