This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Soft Skills: The software developer's life manual and have John Sonmez on-line!
See this thread for details.
Win a copy of Soft Skills: The software developer's life manual this week in the Jobs Discussion forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Embedding other web apps output in a single JSP

 
Felix Li
Ranch Hand
Posts: 38
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64171
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If I'm getting what you are asking, I believe that the JSTL <c:import> action is what you seek.
 
Felix Li
Ranch Hand
Posts: 38
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks again, Bear. Your response time is really quick!
 
Felix Li
Ranch Hand
Posts: 38
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64171
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<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
Posts: 12
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic