About Question enthuware.jwpv6.2.831 :

Moderator: admin

Post Reply
goetz
Posts: 11
Joined: Wed Jan 18, 2012 8:32 am
Contact:

About Question enthuware.jwpv6.2.831 :

Post by goetz »

Option C would also work if it was changed to:

Code: Select all

<%@ taglib prefix="mytags" uri="http://abc.com/tld/mytaglib" %>
It works because per spec 7.3.4 the container searches WEB-INF and its subdirectories for tld files and automatically register the URI in those files. Of course, if the "typo" is intentional (spelling abt.com instead of abc.com) then there's no issue.

viva

Re: About Question enthuware.jwpv6.2.831 :

Post by viva »

Hi,

"<%@ taglib uri="/WEB-INF/tlds/tld1.tld" prefix="mytags" %>

Note that, the uri must be a context relative (i.e. it must start with /). Prefix can be anything that you want to use in your jsp page."

But i believe that it could be relative to current page as well...

"
JSP.7.3.6.2 Computing the TLD Resource Path
..........

• If uri is noroot_rel_uri, a relative URI that does not start with /
Look in the taglib map for an entry whose taglib_uri is noroot_rel_uri. If found,
the corresponding taglib_location is the TLD resource path. If no such entry is
found, resolve noroot_rel_uri relative to the current JSP page where the directive
appears; that value (by definition, this is a relative URI specification that starts
with /) is the TLD resource path. For example, if /a/b/c.jsp references
../../WEB-INF/my.tld, then if there is no taglib_location that matches
../../WEB-INF/my.tld, the TLD resource path would be /WEB-INF/my.tld."


Thanks

Post Reply

Who is online

Users browsing this forum: No registered users and 9 guests