*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes uri vs tagdir in tablib doubt 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 vs tagdir in tablib doubt" Watch "uri vs tagdir in tablib doubt" New topic
Author

uri vs tagdir in tablib doubt

Garlapati Ravi
Ranch Hand

Joined: Mar 05, 2008
Posts: 168
Hi all,

<%@ taglib uri="WEB-INF/taglib.tld" prefix="h" %>
<%@ taglib tagdir="/WEB-INF/tags/taglib.tld" prefix="h" %>

can't we use 'uri' attribute in place of 'tagdir' attribute in the below directive.

could any one explain when exactly we use tagdir, where uri doesn't work.


Ravi Kumar
SCWCD 5 - 89%, SCJP 1.4 - 90%
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

could any one explain when exactly we use tagdir, where uri doesn't work.

If you have made a TLD for your library where a uri is set, then you can use the uri attribute. For Tag Files under WEB-INF/tags, the container will make an implicit TLD for you, but you don't know the uri. So you'll use the tagdir instead.


[My Blog]
All roads lead to JavaRanch
Kumar Garlapati
Ranch Hand

Joined: Feb 04, 2008
Posts: 38
but you don't know the uri


what does it mean ?

how would i don't know where my .tld file reside. as a developer i know where i placed my tld, in that case i can use uri itself, then what is the use of tagdir attribute.


Regards,<br />Kumar
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

as a developer i know where i placed my tld

That's right. But with Tag Files (*.tag) under WEB-INF/tags (or any subdirectories), you don't need to make a TLD. So you don't know the uri either, as there isn't any.
 
jQuery in Action, 2nd edition
 
subject: uri vs tagdir in tablib doubt
 
Similar Threads
Tag library
Exmulator mock exam question 36
taglib doubt
uri element ,taglib element
Tag Files location!!