• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Pop up new HTML page in JSP

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 Hu
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you like to forward request to other page use
<jsp:forward page="url">
</jsp:forward>
 
Vladimir Kositsky
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you like to forward request to other page use
<jsp:forward page="url">
</jsp:forward>
 
Sheriff
Posts: 7001
6
Eclipse IDE Python C++ Debian Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic