• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

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
 
What does a metric clock look like? I bet it is nothing like this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic