Win a copy of Spring in Action (5th edition) this week in the Spring forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Ganesh Patekar
  • Frits Walraven
  • Tim Moores
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Stephan van Hulst
  • salvin francis
  • Tim Holloway

Location of tld files  RSS feed

 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • 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
  • 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
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!