aspose file tools*
The moose likes JSP and the fly likes how to show 2 JSP on a webpage split screen Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "how to show 2 JSP on a webpage split screen" Watch "how to show 2 JSP on a webpage split screen" New topic
Author

how to show 2 JSP on a webpage split screen

Kumar Manthri
Greenhorn

Joined: May 14, 2003
Posts: 5
Hi,
This is my first posting, I have 2 outputs from a JSP file which is shown on different webpage. How do I show this in 1 webpage. I both the outputs to be showed in one webpage butin a split screen manner.
please help
Philip Shanks
Ranch Hand

Joined: Oct 15, 2002
Posts: 189
It sounds like you want to be using a frameset with the two JSP's in separate frames. This way you can provide optional scroll bars for the two pieces of the screen, specify sizes, etc.
You can do it w/o frames if you like (more of an HTML purist approach) by using a third JSP that does a couple of <jsp:include>'s inside of an HTML table layout (this gives you control of how much real estate each page gets, and you can use broders to get that split screen look).
If you want the two parts of the screen to re-load or submit separately, then you should probably go with the frames approach. It depends on what sort of behavior you want to provide.
Hope this helps.


Philip Shanks, SCJP - Castro Valley, CA
My boss never outsources or has lay-offs, and He's always hiring. I work for Jesus! Prepare your resume!
Kumar Manthri
Greenhorn

Joined: May 14, 2003
Posts: 5
Thanks for the tip, can you show me a sample as just to show 2JSPs in one webpage
Thanks
Philip Shanks
Ranch Hand

Joined: Oct 15, 2002
Posts: 189
Sorry, I don't have time to construct a demo for you, but here is an HTML frames reference that you should find useful. Just point the src attributes of the <FRAME> tags to your JSP's.
Oh, and if the client is not accepting session cookies, then the frameset may to be a JSP file as well, in order to maintain session state. If you can use session cookies, then I think that a regular HTML file will suffice for the frameset.
[ May 14, 2003: Message edited by: Philip Shanks ]
Kumar Manthri
Greenhorn

Joined: May 14, 2003
Posts: 5
Hi,
Thanks for the help, I just have one more problem
I use the below code HTML codeto send a query to the 1 of the JSPs
<FORM method="post" action="goo.jsp" METHOD="GET">
<input type="text" name="sample">
<input type="submit" name="Search" value="Search">
how do I send the output of the goo.jsp to this split screen
Philip Shanks
Ranch Hand

Joined: Oct 15, 2002
Posts: 189
You want to read up on the "target" atrribute of the <FORM> tag. With that attribute you can specify that the result is sent to a specific target, which can be a frame or a child window.
[ May 14, 2003: Message edited by: Philip Shanks ]
Kumar Manthri
Greenhorn

Joined: May 14, 2003
Posts: 5
Thanks for the help
but you see where this code is
<FORM method="post" action="goo.jsp" METHOD="GET">
<input type="text" name="sample">
<input type="submit" name="Search" value="Search">
</FORM>
there should be no split screen the results of goo.jsp should appear in a split screen
Chris Baron
Ranch Hand

Joined: Mar 21, 2003
Posts: 1049
Hi Kumar,
in the frameset.html you specify names for both "screens" ( in example of the link Philip posted, e.g. it's "main" and "menu" )
<FORM method="post" action="goo.jsp" METHOD="GET" target="main">
cb
Debashish Chakrabarty
Ranch Hand

Joined: May 14, 2002
Posts: 225

Apropos the initial post, another way to display the two JSPs in a split-frame way would be to use IFrames. Have a JSP with two IFrames displaying your these two JSPs..not a bad idea I suppose


Debashish
SCJP2, SCWCD 1.4
Philip Shanks
Ranch Hand

Joined: Oct 15, 2002
Posts: 189
Debashish offered:
Apropos the initial post, another way to display the two JSPs in a split-frame way would be to use IFrames. Have a JSP with two IFrames displaying your these two JSPs..not a bad idea I suppose

Personally, I tend to shy away from the "bleeding edge" tags. There are still way too many older browsers that don't support them. There are, after all, still a significant number of web developers that won't even use FRAME's.
That being said, I have seen this approach used to nice effect in providing "drop down" style navigation menus. Visibility of the IFRAME element is controlled by mouseover, and the IFRAME's are filled by JSP's.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to show 2 JSP on a webpage split screen
 
Similar Threads
Microsoft Office SDK for java
How to show image in jsp from any where using browse button?
How to link JFreeChart with JSP
Use Servlet to read a webpage.
img tag does not display image