A web application contains a tag file called beta.tag in/WEB-INF/tags/alpha. A JSP page called sort.jsp exists in the web application and contains only this JSP code: 1. <%@ taglib prefix="x" 2. tagdir="/WEB-INF/tags/alpha" %> 3. <x:beta /> The sort.jsp page is requested. Which two are true? (Choose two.) A. Tag files can only be accessed using a tagdir attribute. B. The sort.jsp page translates successfully and invokes the tag defined by beta.tag. C. The sort.jsp page produces a translation error because a taglib directive must always have a uri attribute. D. Tag files can only be placed in /WEB-INF/tags, and NOT in any subdirectories of /WEB-INF/tags. E. The tagdir attribute in line 2 can be replaced by a uri attribute if a TLD referring to beta.tag is created and added to the web application.
This involves some knowledge not directly described by HFSJ.
tagdir is used to refer to the location of the tag file?
uri is optional ?
Diploma in Computer Studies
Formula 1 app by Maxis (Playbook)
Joined: Jan 28, 2004
As I said, this is not described in HFSJ. Consider this, if the tag file is placed inside a jar file under /WEB-INF/lib/, what is required to invoked such a tag file? Should tagdir used in <%@ taglib %>?
I think that if you have a tld where you declare the tag file then you can use the taglib directive with the uri of that tld.
quote from HFSJ : "if you make a tld that references your tag files, the container will consider both tag files and custom tags mentioned in the same tld as belonging to the same library"
Correct answers in my opinion: B and E
Joined: Mar 26, 2005
Originally posted by Srinivasan R: I think A,B and E are correct choices here.
Any objections to this Friends!
A. Tag files can only be accessed using a tagdir attribute.
option A is NOT correct. it is not the only way to access tag file using a tagdir attribute. There is another way, using uri attribute in taglib directive and then Container will automatically map to the tag file to find the appropriate uri match in the tld.
correct me if i'm wrong.
this tagdir bring confusion with uri...???what if we put uri and tagdir in the same time ??