This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
4. The following prefixes cannot be used: java,servlet and sun.
5. If the uri contains an absolute path to a jar file then all handler classes should be included in the jar file and cannot be defined in the web-application classpath.
The Answer is given as
Answer 3, 4 and 5 are correct. Answer 1 and 2 are incorrect, the uri elements can contain an absolute or relative path that identifies the tag library descriptor. Answer 3 is correct, the unique string is used in the <prefix:tagname> declaration. Answer 4 is correct, the following prefixes are reserved and cannot be used: jsp, jspx, java, javax, servlet, sun and sunw. Answer 5 is correct, all classes and TLD file must be located in the Jar file.
Can any one tell is the option 5 is true.
if the uri contains the absolute path to the jar is that it is neccessary to have handler classes to be inside the jar
I think 5 is not correct. The uri is only a string to map a location. There is no link between the uri and the location. The tld must be under the WEB-INF or if in a jar, it should be under the META-INF directory. That is where the container looks to create his taglib-map that contains the all the uri-location of the tld's.
where did you find this question ?
Selva Prasad Rajendran
Joined: Sep 07, 2004
i found this question in j2eecertificate.com. I read that the TLD's must be some where under WEB-INF or sub directore of WEB-INF . If deployed in a JAR then it must be under META-INF or Subdirectory of META-INF
and Tag Handler classes or any classes must be inside WEB-INF/classes in a directory structure matching the package or in the appropriate package directory with in the a JAR inside WEB-INF/lib.
but is that necessary that the Tag Handler class should be inside the JAR file when the tld is in the META-INF folder of the JAR.
This is my own interpretation, but i wouldn't think so. If the container can find the tld, it knows where to find the class (<tag-class> in the tld). Wether the class is located in the jar or in the classes dir makes no difference. It uses the classpath to find the class, and both (web-inf/classes and jar files) are autmatically put in the path when the container starts up.