aspose file tools*
The moose likes JSP and the fly likes Embedding other web apps output in a single JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Embedding other web apps output in a single JSP" Watch "Embedding other web apps output in a single JSP" New topic
Author

Embedding other web apps output in a single JSP

Felix Li
Ranch Hand

Joined: Jul 09, 2008
Posts: 38
I am trying to find a solution in which a JSP is required to specify the layout and forward request params to some non-Java web apps. I am still kinda new to J2EE, but I guess the idea is similar to <jsp:forward> but instead I need the output back to the jsp and align it something like:

<html><body>
blahblah...
<input type= ...>
<input type= ...>
<div>
output from non-jsp webapp1
</div>
<div>
output from non-jsp webapp2
</div>
...
</body>
</html>

Thanks in advance.


FL<br /> <br />SCJP,SCWCD
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61415
    
  67

If I'm getting what you are asking, I believe that the JSTL <c:import> action is what you seek.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Felix Li
Ranch Hand

Joined: Jul 09, 2008
Posts: 38
Thanks again, Bear. Your response time is really quick!
Felix Li
Ranch Hand

Joined: Jul 09, 2008
Posts: 38
By the way, does it mean that, using <c:import> is always the best solution compare to the other two method(page directive and <jsp:include>) ??? since it contains the same functionality AND can reach web app outside of the current container.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61415
    
  67

<c:import> is useful because it doesn't matter whether the resource is local or remote.

For local "includes" though, I tend to write tag files rather than include JSP fragments.
kelby zorgdrager
Greenhorn

Joined: Feb 05, 2008
Posts: 12
as a quick side note.. if you use the c:import or some other means, instead of using a fragment, you will probably want to parse out the <html><head> and <body> tags / sections and just place the body content inline.


<a href="http://www.J2EETraining.com" target="_blank" rel="nofollow">J2EE Training / Java EE Training ... Learn Java EE </a>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Embedding other web apps output in a single JSP