• 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
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

uri

 
Ranch Hand
Posts: 393
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Consider the following taglib definition in the deployment descriptor. Which of the following directives can be used inside a JSP page?
1. <% taglib name="/tableutils" prefix="u" %>
2. <%@ taglib uri="tableutils" prefix="u" %>
3. <%@ taglib uri="/tableutils" prefix="u" %>
4. <%@ taglib="/utils" prefix="u" %>
5. <%@ taglib url="/tableutils" prefix="u" %>


Answer 3 is correct.
Answer 1 is incorrect, the attribute name is invalid with the taglib directive and the directive is incorrectly declared (<% instead of <%@)
Answer 2 is incorrect, the URL within the uri attribute has to be relative according to the web.xml declaration.
Answer 4 is incorrect, the URL is incorrect.
Answer 5 is incorrect, the url attribute is invalid for the taglib directive.

The taglib directive in a JSP page declares that the page uses a tag library, uniquely identifies the tag library using a URI and associates a tag prefix that will distinguish usage of the actions in the library.

--------
I don't understand the question.. In HFS it says, that URI is just a name & not a location & the explaining given is ....??/ please help
 
Nikhil Jain
Ranch Hand
Posts: 393
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
sorry i forgot to add the dd tags

<taglib> <taglib-uri>/tableutils</taglib-uri> <taglib-location>/WEB-INF/tld/utils.tld</taglib-location></taglib>
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Which one don't you understand ? Number 2 ?

It says : the URL within the uri attribute has to be relative according to the web.xml declaration.
It's a bit awkward to say it this way indeed. The uri in web.xml starts with a slash, whereas the one in answer two doesn't. As you said, uri is just a name, so it has to match the one you have in web.xml.
 
Nikhil Jain
Ranch Hand
Posts: 393
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, this is the reason my answer was correct. But my question was that..the explaning given was not in any way mentioning the concept given in HFS..
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, I think it's misleading too. I think that the answer should be something like : "Wrong. The uri should be the same as the one declared in web.xml".
 
reply
    Bookmark Topic Watch Topic
  • New Topic