• 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

taglib-location doubt

 
Ranch Hand
Posts: 166
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is it necessary for the taglib-location to start with "/" and does the container by default adds /WEB-INF to the location we give.

<taglib>
<taglib-uri>helloWorld</taglib-uri>
<taglib-location>/hello.tld</taglib-location> (or)
<taglib-location>hello.tld</taglib-location>

</taglib>


Thanks
Srividhya
 
Ranch Hand
Posts: 5575
Eclipse IDE Windows XP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Srividhya Kiran:
Is it necessary for the taglib-location to start with "/" and does the container by default adds /WEB-INF to the location we give.



As far as i know, you have to start with "/".i think you can put tld in where your jsp is in. so "/" is required.

correct me ,if i am wrong
 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
tld files cannot be in any location. With JSP 2.0, the container automatically checks for tld files inside /WEB-INF or any sub directories inside WEB-INF folder. If its going to be in a jar, it has to be inside /META-INF (/subdirectories). But with JSP versions below 2.0, we have to give an entry for the tld files in the web.xml file as follows:


The taglib location should always start with /WEB-INF or /META-INF in case the tld is to be inside a jar
[ August 04, 2008: Message edited by: Hema Nandhini ]
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Windows XP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Hema Nandhini
 
Srividhya Kiran
Ranch Hand
Posts: 166
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hema

Thanks for your reply. If the container is going to directly look for tld files under WEB-INF then why do we need the location to start with /WEB-INF instead we can start with /hello.tld in my example, so that the container directly looks for hello.tld under WEB-INF directory.

According to your case if we give the location as /WEB-INF/myTag.tld then the container will look for a directory WEB-INF under WEB-INF (which doesnt exist) since the container directly checks under WEB-INF directory for tld files.

Correct me If I am wrong.

Srividhya
 
Hema Nandhini
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Srividhya, there are some changes in my answer too!! check this post for better understanding

https://coderanch.com/t/171933/java-Web-Component-SCWCD/certification/do-tlds-uris-taglibs

By the way, thanks to you, I too got a better understanding
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic