This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan 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 | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android 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: 60794
    
  65

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 ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Some way to include() from inside a TagSupport instance?
 
Similar Threads
Q? on body-content tagdependent /body-content
Xdoclet doesnot capture tags in tld file
Mock Questions
Performance of custom tag
Including JSP templates in Taglibs