aspose file tools*
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 | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » JSP
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: 61764
    
  67

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


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by 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 ]
 
wood burning stoves
 
subject: Some way to include() from inside a TagSupport instance?