• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

"taglib" and "uri" attributes of taglib directive

 
Ranch Hand
Posts: 252
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes thats correct.
 
Nidhi Sar
Ranch Hand
Posts: 252
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Shobhan!
 
reply
    Bookmark Topic Watch Topic
  • New Topic