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 creating a template jsp page 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 "creating a template jsp page" Watch "creating a template jsp page" New topic
Author

creating a template jsp page

Maxim Katcharov
Ranch Hand

Joined: Sep 07, 2004
Posts: 113
I have a 'template' jsp, into which I'd like to insert the output of another jsp. However, this isn't as simple as



since I don't want to hard code the page that I'm including. I could of course do the following:



but I would much rather just add something like



to the template page. Unfortunatley, this isn't allowed. So I tried



as a hack. Unfortunatley, I don't seem to know what I'm doing anymore (if I ever did), since this either spits out directly after the last normal include action, or throws a "getOutputStream() has already been called for this response".

The real question here is, how do I make a template into which I can toss various types of content? (without creating two files, making the code illegible, or making it not work at all)
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60794
    
  65



or better yet, check out the <c:import> tag of the JSTL.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Maxim Katcharov
Ranch Hand

Joined: Sep 07, 2004
Posts: 113
Thank you, I didn't know that that could be done. And thanks for the tip, I'll look it up.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: creating a template jsp page
 
Similar Threads
Struts redirect tag
Tracking User's requests.
doubts realted to include directive
Design patterns for templates (or something like that ...)
Including a file dynamically