File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Doubt on 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 "Doubt on taglib?" Watch "Doubt on taglib?" New topic

Doubt on taglib?

Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 10032

Hi Guys,

I have the following doubt on taglibs...what is the difference between uri and tagdir attribute for the <@taglib ...>???

SCJP 1.4, SCWCD 1.4 - Hints for you, Certified Scrum Master
Did a rm -R / to find out that I lost my entire Linux installation!
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 10032

Any replies guys for the above post??
madhav changala
Ranch Hand

Joined: Dec 20, 2005
Posts: 57
Hello Jyothi

Your questions are not understanding what you need..

Could you please explain indetail..

Here taglib is directive.. uri and prefix are attributes of the taglin directive..

tagdir is another attribute we can use instead of "uri"

Limiataion is we can not use both at a time...

some other limitation liste below


If the URI is a URL or URN, then the TLD is located by consulting the mapping indicated in web.xml extended using the implicit maps in the packaged tag libraries. If URI is pathname, it is interpreted relative to the root of the web application and should resolve to a TLD file directly, or to a JAR file that has a TLD file at location META-INF/taglib.tld.


Indicates this prefix is to be used to identify tag extensions installed in the /WEB-INF/tags/ directory or a subdirectory. An implicit tag library descriptor is used. A translation error must occur under any of these conditions:

The value does not start with /WEB-INF/tags/.
The value does not point to a directory that exists.
If this attribute is used in conjunction with the uri attribute.



Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 10032

Thanks Madhav. I got to understand it now. So you can use either uri or tagdir but not both. uri is for already existing taglibs but tagdir is for the custom ones that we write! Correct me if I'm wrong!
I agree. Here's the link:
subject: Doubt on taglib?
It's not a secret anymore!