• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

custom tags must have a TLD?

 
nagalatha mitta
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi friends
I have a dought regarding custom tags(which is used to invoke Tag File)and its TLD.
HFSJ book page 500-says that "custom tags must have a TLD ,but Tag Files can declare attributes and body-content directly inside the Tag File,and need Tlds only if the Tag File is in a JAR."
my dought is:if my custom tag is trying to invoke Tag File ,then what to configuer in <name> and <tag-class> subelements of <tag> in TLD?
If anybody knows the answer please let me know.


Thanks in advance
 
Dave Seligson
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Custom tags don't invoke tag files.
Tag files are the *special case* of tags that don't need a tag class.
Tag files are an easy way for your non-java-programming team to include
EL-processed jsp fragment files, like headers or footers.

Custom tags, alternatively, require a java class extended by one of the Tag Support classes, and thus require a nice meaty section in your TLD file.

DaveS
SCJP
 
Sourin K. Sen
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Dave,

I think Nagalatha is trying to say that if a tag file is in a JAR inside the lib folder, then according to the specs, it MUST have a tld file associated with it.

So in this case how to configure the tld for the tag file?(Even I had the same question in mind...)

Nagalatha, please let me know if I interpreted your question properly or not...
 
Ashwin Kumar
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi folks,

If the question must be interpreted as "How to configure Tag files in TLD, when placed inside JAR?", then I think following would be the answer.

Use <tag-file> element in your tld to configure.

 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic