| Author |
TLD doubt
|
Srividhya Kiran
Ranch Hand
Joined: Feb 17, 2008
Posts: 166
|
|
The tag library descriptor shown in the exhibit has been kept in /WEB-INF/mytlds/tld1.tld folder of the webapplication. What should be inserted at line 6 so that line 7 will work as expected? 5. ... 6. <<INSERT CODE HERE >> 7. <mytags:tag1 /> tld1.tld: Assume that the application can be accessed through http://localhost/myapp 1. <% taglib prefix="mytags" uri="/WEB-INF/mytlds/tld1.tld" %> 2. <% taglib prefix="mytags" uri="http://abt.com/tld/mytaglib" %> correct answer option 1. why option 2 is wrong? Srividhya
|
 |
Charles Lyons
Author
Ranch Hand
Joined: Mar 27, 2003
Posts: 836
|
|
|
Both of those are incorrect as they should start with <%@ as in:Also you write "abc.com" in the TLD and "abt.com" in your answers - was this deliberate? Aside from that, I notice nothing immediately wrong with either possibly answer, though the full TLD hasn't been given so some assumptions need to be made. Traditionally (i.e. pre J2EE 1.4) only method 2 worked; the first approach was added as an extra in J2EE 1.4. You might also find this useful from the IBM Rational site.
|
Charles Lyons (SCJP 1.4, April 2003; SCJP 5, Dec 2006; SCWCD 1.4b, April 2004)
Author of OCEJWCD Study Companion for Oracle Exam 1Z0-899 (ISBN 0955160340 / Amazon Amazon UK )
|
 |
Srividhya Kiran
Ranch Hand
Joined: Feb 17, 2008
Posts: 166
|
|
Charles Sorry for those mistakes. Please find the correct code below The tag library descriptor shown in the exhibit has been kept in /WEB-INF/mytlds/tld1.tld folder of the webapplication. What should be inserted at line 6 so that line 7 will work as expected? 5. ... 6. <<INSERT CODE HERE >> 7. <mytags:tag1 /> tld1.tld: code: <uri>http://abc.com/tld/mytaglib</uri> <tag> <name>tag1</name> <tag-class>com.abc.Tag1</tag-class> <body-content>scriptless</bodycontent> </tag> Assume that the application can be accessed through http://localhost/myapp 1. <%@ taglib prefix="mytags" uri="/WEB-INF/mytlds/tld1.tld" %> 2. <%@ taglib prefix="mytags" uri="http://abc.com/tld/mytaglib" %> If we were asked to select either of these options which one should we select? Thanks Srividhya
|
 |
Charles Lyons
Author
Ranch Hand
Joined: Mar 27, 2003
Posts: 836
|
|
|
They both look correct to me... so you wouldn't get a real SCWCD exam question asking you to choose between them. Sometimes mocks can be a bit peculiar - what is the source of your question?
|
 |
 |
|
|
subject: TLD doubt
|
|
|