• Post Reply Bookmark Topic Watch Topic
  • New Topic

about multiple custom tag  RSS feed

 
kenji kunoichi
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
see I want to have 2 custom tag appearing in a single jsp page .

so for that do I need to create 2 .tld files as well as 2 .java class ?

 
Santhosh Reddy
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, for every custom tag there should be one tld and a class file.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can put multiple tags in a single TLD.

If you're writing Java-based custom tags of course there will be multiple class files. If you're using JSP-based tags there will be multiple tag files, but no TLD.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66207
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Santhosh Reddy wrote:Yes, for every custom tag there should be one tld ...

As David pointed out, this is incorrect. A single TLD defines one library, which can contain multiple tags, functions, and tag file declarations.

David Newton wrote:If you're using JSP-based tags there will be multiple tag files, but no TLD.

However, if you want the tag files to have the same prefix as non-file tags or other functions, they can also be declared in the TLD.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!