• Post Reply Bookmark Topic Watch Topic
  • New Topic

Embedding a tag library within another tag library  RSS feed

 
Nicholas Turner
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can I embed a tag within another tag (tag libraries)
lets say I have two tags tag1 and tag2
<mytags:tag1>
<.. some body content for tag1 ...>
<mytag:tag2>
<... some body content for tag2 ...>
</mytag:tag2>
<... some body content for tag1 ...>
<mytag:tag2>
<... some body content for tag2 ...>
</mytag:tag2>
<... some body content for tag1 ...>
</mytag:tag1>
If i create them separately can I embed them or do I have to add code within my tag class or is it not possible?
thanks,
nick
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You sure can! (Terminology nit: you are not asking about nesting tag libraries whithin one another -- you are asking whether custom tags can be nested. A tag library is a set of custom tags defined within a TLD file.)
In fact, by creating cooperating tags that nest within each other, you can create some very useful and powerful constructs.
No special declarations or coding is necessary to allow such nesting. But if you want them to be able to find each other, check out the findAncestorWithClass() method.
hth,
bear
[ May 30, 2003: Message edited by: Bear Bibeault ]
 
Nicholas Turner
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you have any links to tutorials or discussions of how I design my class or anything related?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!