aspose file tools*
The moose likes Servlets and the fly likes How to open another browser window in a jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "How to open another browser window in a jsp" Watch "How to open another browser window in a jsp" New topic
Author

How to open another browser window in a jsp

Neha Sharma
Ranch Hand

Joined: Jul 13, 2001
Posts: 126
Hi,
I have a requirement of opening another browser window when a press a button on my JSP. how can I achieve that. Also guide me how will I get the record selected value from that new session to my original JSP.
Thanks
Neha
sanjay yermalkar
Greenhorn

Joined: Sep 19, 2001
Posts: 23
As server cannot distinguish between different windows of the same browser, all windows share the session. So, there is no 'new' session.
You can write a simple javascript function for opening a new window. like this :
<script language="JavaScript">
function newWindow()
{
window.open("http://www.cnn.com");
}
</script>
Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695

or in plain html < a href="blah.jsp" target="top" >New Window < /a>
Neha Sharma
Ranch Hand

Joined: Jul 13, 2001
Posts: 126
Great!! thanks Mike and Sanjay
Neha
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: How to open another browser window in a jsp