• 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
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Is tld file necessary?

 
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear dudes,
I was working with JSTL , in which i'm using pre-defined tag libraries which contains many functionalities which is defined in TLD files. For example:

<%@ taglib uri="WEB-INF/tld/struts-html" prefix="html" %>
Here this means i can use the html tags functionality which is defined in the uri i.e. tld files which defines the class and functionality.

here if i use some X() functionality in html tags, the container goes through the tld files and finds the corresponding method or function.

Why this should be like this?

<%@ taglib uri="WEB-INF\lib\struts.jar" prefix="html" %>

Why can't i directly refer the location of resource ( here the jar file) to the container so that these intermediate tld file mapping can be skipped.

Why is the tld file significant?

Any valid reply would be appreciated.

regards.
 
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are you asking about the need of the tld itself or just the uri ?
 
mara thamizhan
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm asking about the need of the tld itself?

About the uri, whether it should match the tag-lib uri we specify in our web.xml or it should match the uri we specify inside the tld file.
How the container tracks the corresponding class file & if that can be done that path we can directly specify in our webpage itself instead of going through tld files.

For example if my struts.jar is in WEB-INF/lib/struts.jar
<%@ taglib uri="WEB-INF/lib/struts.jar" prefix="html" %>

Why this is not possible?
 
Pedro Erencia
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I'm asking about the need of the tld itself?



Maybe a dot ? It seems to me by what are you saying later.




How the container tracks the corresponding class file & if that can be done that path we can directly specify in our webpage itself instead of going through tld files.



A tld contains metadata about an entire tag library. Each tag inside this tag library can be implemented in a differente tag class. Moreover, how do you express if an attribute is required or if it can be an rtexpr in the class file ?

For example if my struts.jar is in WEB-INF/lib/struts.jar
<%@ taglib uri="WEB-INF/lib/struts.jar" prefix="html" %>

Why this is not possible?



This is possible whenever you include a tld called taglib.tld inside the META-INF directory inside the jar.
 
reply
    Bookmark Topic Watch Topic
  • New Topic