aspose file tools*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes URI in directive <%@ taglib %> Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "URI in directive <%@ taglib %>" Watch "URI in directive <%@ taglib %>" New topic
Author

URI in directive <%@ taglib %>

Bruno Carneiro
Greenhorn

Joined: Jun 24, 2009
Posts: 7
Hey folks!

I'm a little bit confused about the attribute "URI" in the directive taglib.
1) Does it a location of the tld?
2) Does the tld need to have the same URI of the directive's URI?
3) When it is like a url, does it get the tld from the specified website?

For me the answers for this questions are: 1) NO 2) YES 3) NO
But, i read that sometimes the container looks the directive's uri and try to get the tld in the uri path. When the tld is not there, the container looks inside of the web.xml, the declaration of the taglib that has that exactly uri, and now it knows where to find the tld. Is that true?
Could someone explain what the container does to find the tld?

Thanks a lot!
Regards
vani venkat
Ranch Hand

Joined: Nov 21, 2006
Posts: 142
uri element in tld is optional. if taglib uri does not match with any of the uri's defined in tlds, container takes uri specified in taglib as path and tries to locate tld.



SCJP 1.4, SCWCD 1.5
Bruno Carneiro
Greenhorn

Joined: Jun 24, 2009
Posts: 7
That's not it. I'm talking about the attribute URI, inside the taglib directive,NOT the tagdir attribute.

<%@ taglib uri="/WEB-INF/c.tld" prefix="c" %>

Like this example above. What will be done?

The container will get this uri and will look for a tld in this path? Or it will look for any tld with this URI and use it?
vani venkat
Ranch Hand

Joined: Nov 21, 2006
Posts: 142
i modified the post. that was a typo. is it clear now?
Bruno Carneiro
Greenhorn

Joined: Jun 24, 2009
Posts: 7
Oh yeah!
It's clear now!!! Thanks for your help!
One more thing: This rule is applied even if the URI is a website?
vani venkat
Ranch Hand

Joined: Nov 21, 2006
Posts: 142
even though uri value is a valid website link, (like the one for custom tags which goes to sun site) for container it is a unique name that represents tld or path to tld.
Bruno Carneiro
Greenhorn

Joined: Jun 24, 2009
Posts: 7
Ok! Thanks a lot vani!
I appreciated!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: URI in directive <%@ taglib %>