• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

TLD doubt

 
Ranch Hand
Posts: 166
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Author
Posts: 836
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Srividhya Kiran
Ranch Hand
Posts: 166
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 836
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Life just hasn't been the same since the volcano erupted and now the air is full of tiny ads.
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic