Help coderanch get a
new server
by contributing to the fundraiser
  • 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

difference between tag and tld

 
Ranch Hand
Posts: 174
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
can anyone tell me the difference between tag and tld
 
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A Tag Library Discriptor(TLD) is an XML like file (like web.xml) used to describe the functions(EL) and tags provided by a user defined tag library.

The tag is the actual element that performs some customizable functionality through its attributes (like <jsp:setproperty>, is used to set property of a java bean) in a JSP file.

I hope that this explains the basic difference though the topic has many other things to be learnt.
 
lalit upadheyay
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry. I cited wrong example for tag. The example i have specified is a standard action. Example of tags in Java Standarad Tag Libraries(JSTL) are <c:if>,<c:forTokens>,<c:forEach>,<c:include>. We only need to learn the tags in core library (nearly 13 tags).
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
isn't rehans talking about tag files ? (*.tag, *.tagx)
 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
talking about tag files,

tag files are an advancement to custom tag libraries

custom tags are in version JSP1.x ..they are nothing but java classes which implement inerfaces like tag, iterationTag, bodyTag..it is a little industrious way of writing tags. In custom tag libs, you have to provide implementation for setter methods methods like setPageContext, setParent, doStartTag, doEndTag, release etc.,

tag files do away with all these methods....they are not even written as classes..they are newly added in JSP 2.0 to reduce the code...they are saved as .tag files... the body of tag files contains JSP code...and you can also use custom tags like JSTL 2.0 inside the body...

hope I am clear,
 
Ranch Hand
Posts: 1026
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


the body of tag files contains JSP code



The most significant aspect to note here is both tag files and simple tag's body cannot have scripting code
 
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As per HFSJ, body of tag files cannot have scripting, however tag files can have scripting.

Don't find any errata related to this as well.
 
What's that smell? Hey, sniff this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/t/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic