Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Calling a TagLib from another taglib is it possible??  RSS feed

 
Reggie McDougal
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If I call a taglib from a JSP with the usual syntax <prefix:tag>, and that tag outputs something like the following <prefix:another tag>, will this output like a nested tag, or, will the <prefix:another tag> end up written to the browser?

Basically, what will happen if I do the above?

Or, is there a better way to "nest" tags?

Reg
[ January 31, 2005: Message edited by: Reggie McDougal ]
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66186
146
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, you cannot emit a tag from a tag and expect it to be evaluated. You can only "nest" tags within the JSP page.
 
Dan Novik
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tag is still a Java class, so it is possible of course
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66186
146
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Of course it is not. If a tag emits tag syntax, that syntax will be passed to the browser uninterpreted.
 
Scott Corley
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you are using the latest JSP spec (2.4), and the tag on the page is defined using tagfiles, I believe that tagfile may use other tags from your taglib.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66186
146
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, tags within a tagfile (JSP 2.0) will be interpreted.
[ February 01, 2005: Message edited by: Bear Bibeault ]
 
Dan Novik
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is possible. Check out evalBody tag here: http://www.servletsuite.com/servlets/evaltag.htm

Tab outputs tags and executes own body again
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!