• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to open another browser window in a jsp

 
Neha Sharma
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
or in plain html < a href="blah.jsp" target="top" >New Window < /a>
 
Neha Sharma
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Great!! thanks Mike and Sanjay
Neha
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic