This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See this thread for details.
The moose likes JSP and the fly likes Some way to include() from inside a TagSupport instance? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » JSP
Reply Bookmark "Some way to include() from inside a TagSupport instance?" Watch "Some way to include() from inside a TagSupport instance?" New topic
Author

Some way to include() from inside a TagSupport instance?

Chris Corbyn
Ranch Hand

Joined: Jan 14, 2007
Posts: 114
I'm struggling to see a way to do the equivalent of:

<jsp:include .. />

By writing my own Tag for it (because the actual path will be unknown to the template).

If I do a simple (in a class extending TagSupport):



Then what happens is that the included JSP is output *before* the rest of the template rather than being nested at the point where the tag is invoked.

If there's something better suited to this than just JSP and tag libraries let me know because I could do with learning about these other terms I'm hearing tossed around (there's too many :P jsp, jsf, jstx, jspx..).
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56529
    
  14

You should be able to use include without issue. Perhaps this article might help?


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
Chris Corbyn
Ranch Hand

Joined: Jan 14, 2007
Posts: 114
*chuckles* I completely missed PageContext.include() and was using RequestDispatcher.include(). Thinking about it logically, it makes perfect sense why I got the template being output too early

[ September 02, 2007: Message edited by: Chris Corbyn ]
[ September 02, 2007: Message edited by: Chris Corbyn ]
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Some way to include() from inside a TagSupport instance?
 
Similar Threads
Performance of custom tag
Q? on body-content tagdependent /body-content
Xdoclet doesnot capture tags in tld file
Including JSP templates in Taglibs
Mock Questions