Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Pop up new HTML page in JSP

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
  • Quote
  • Report post to moderator
If you like to forward request to other page use
<jsp:forward page="url">
</jsp:forward>
 
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
  • 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
 
Consider Paul's rocket mass heater.
    Bookmark Topic Watch Topic
  • New Topic