• 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
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Location of tld files

 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I got this from HFS p486

Tld files can be located :
1. Directly inside WEB-INF
2. Directly inside a sub directory of WEB-INF
3. WEB-INF/lib/jar/META-INF/
4. In a subdirectory of WEB-INF/lib/jar/META-INF/

Question: If it can be located directly inside a sub directory of WEB-INF, then can a tld be located by the container if its situated within /classes or /lib ? or are these two folders not searched by the container?

I also I read the next chapter on tag files. It mentiones that you only need to declare a tld file, if the tag file is located in a jar file.
So what happens if your tag file is located inside the /WEB-INF/tags location.

Question 2: So if the tag file (Header.tag) is located in /WEB-INF/tags and there is no tld file defined. Does this mean i have to have a 'tagdir' defined in a taglib directive in my jsp:

<%@ taglib prefix="myTags" tagdir="/WEB-INF/tags" %>

<myTags:Header />

Or since the tag file is in /WEB-INF/tags, do i not need to specify the tagdir? E.g. Can i just say:

<%@ taglib prefix="myTags" %>

<myTags:Header />

Since Header.tag exists in a folder that the container searches?
 
Ranch Hand
Posts: 142
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I also I read the next chapter on tag files. It mentiones that you only need to declare a tld file, if the tag file is located in a jar file.
So what happens if your tag file is located inside the /WEB-INF/tags location.




you donot need to declare a tld file for tags inside web-inf/tags directory or its sub directories.

for the second question, taglib directive should have either uri or tagdir , see this
 
World domination requires a hollowed out volcano with good submarine access. Tiny ads are optional.
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic