aspose file tools*
The moose likes Servlets and the fly likes Pop up new HTML page in 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 » Servlets
Bookmark "Pop up new HTML page in JSP" Watch "Pop up new HTML page in JSP" New topic
Author

Pop up new HTML page in JSP

Jimmy Hu
Greenhorn

Joined: Feb 05, 2001
Posts: 17
Hi,
Could you please tell me how to pops up a HTML page in a new
browser frame from a JSP/bean? Therefore there two html pages
in different frame after a JSP 's execution.
Thanks
Jimmy


Jimmy
Jimmy Hu
Greenhorn

Joined: Feb 05, 2001
Posts: 17
Hi,
I found a way of using javascript to open new HTML page
from JSP or html:

<script language="JavaScript" >
win = window.open();
win.document.open();
win.document.write("<p><Thank you for purchase:</p> ");
win.document.close();
</script>
Is this the only way to do that? The ideal way I can imagine
is to use JSP to pops up a new HTML and this new HTML can
inherit the same <jsp:useBean ...> instance from the parent.
I don't know whether or not it is possible.
regards
Jimmy
Vladimir Kositsky
Ranch Hand

Joined: Nov 03, 2000
Posts: 116
If you like to forward request to other page use
<jsp:forward page="url">
</jsp:forward>
Vladimir Kositsky
Ranch Hand

Joined: Nov 03, 2000
Posts: 116
If you like to forward request to other page use
<jsp:forward page="url">
</jsp:forward>
Frank Carver
Sheriff

Joined: Jan 07, 1999
Posts: 6920
The usual way is to call a Javascript method to open a new window. You can either manually populate it as shown above, or (more simply) populate it from a URL. If you include the javascript either literally in the document generated from the JSP, or attach it to the onload event handler of the body tag it will cause the window to be opened automatically:
page1.jsp

page2.jsp


Read about me at frankcarver.me ~ Raspberry Alpha Omega ~ Frank's Punchbarrel Blog
 
 
subject: Pop up new HTML page in JSP