aspose file tools*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes 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 ""taglib" and "uri" attributes of taglib directive" Watch ""taglib" and "uri" attributes of taglib directive" New topic
Author

"taglib" and "uri" attributes of taglib directive

Nidhi Sar
Ranch Hand

Joined: Oct 19, 2009
Posts: 252

As I understand, the taglib directive can be of one of the two following formats:


OR


I'm a little confused as to when to use which format.

This is what I have understood:
Use taglib attribute for tag files (with or without a .tld file fr)
Use uri attribute for EL functions, JSTL & custom tag handlers (in conjuntion with a .tld file)

Is this correct?

Edits: Just reflect my confusion about the whole thing, I guess!


"A problem well stated is a problem half solved.” - Charles F. Kettering
SCJP 6, OCPJWCD
Shobhan Ganta
Ranch Hand

Joined: Nov 11, 2010
Posts: 37
Hi Nidhi,

<% taglib prefix="pre" taglib="/WEB-INF/tags/mytags" %>


the attribute is 'tagdir' not 'taglib'

<%@ taglib prefix="myTags" tagdir="/WEB-INF/tags/mytags" %>

This is what I have understood:
Use taglib attribute for tag files (with or without a .tld file fr)
Use uri attribute for EL functions, JSLT & custom tag handlers (in conjuntion with a .tld file)


Use tagdir attribute for tag files (with the ".tag" or ".tagx" extension)

Note: Use the "tagdir" attribute instead of the "uri "attribute used for tag libraries

Regards
Shobhan
Nidhi Sar
Ranch Hand

Joined: Oct 19, 2009
Posts: 252

Shobhan Ganta wrote:the attribute is 'tagdir' not 'taglib'


Hi Shobhan, yup, it should be tagdir, not taglib... sorry for the typos.

Shobhan Ganta wrote:
Use tagdir attribute for tag files (with the ".tag" or ".tagx" extension)

Note: Use the "tagdir" attribute instead of the "uri "attribute used for tag libraries


So tagdir is just for the tag files, right? And uri for all tag libraries (JSTL or custom) or EL function libraries?
Shobhan Ganta
Ranch Hand

Joined: Nov 11, 2010
Posts: 37
Yes thats correct.
Nidhi Sar
Ranch Hand

Joined: Oct 19, 2009
Posts: 252

Thanks Shobhan!
 
 
subject: "taglib" and "uri" attributes of taglib directive