Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

"taglib" and "uri" attributes of taglib directive

 
Nidhi Sar
Ranch Hand
Posts: 252
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
Shobhan Ganta
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 252
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes thats correct.
 
Nidhi Sar
Ranch Hand
Posts: 252
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Shobhan!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic