Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Can a servlet open a new browser window?

 
Vanchi Nathan
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all,
Is it possible for a servlet to open a new browser window where an JSP page is displayed?
Your advise please!!!
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64838
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not directly.
It can, however, return a response containing Javascript that can perform this operation.
 
Vanchi Nathan
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks...
In this case, assume the servlet uses an session object; will the same session object be visible in the new browser window?
please advise...
 
john smith
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It can either behave in a stateful way and put what ever data you need in the session, or pass the data using hidden form fields or by programatically adding the data to the request.
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Lokanathan Vanchinathan:
In this case, assume the servlet uses an session object; will the same session object be visible in the new browser window?

Yes and no. The new window should automatically take up the existing session, but there is a bug in Internet Explorer (v5?) where it creates a new session for the pop-up window. You can use url rewriting to force the second window to take up the existing session.
Dave
 
Jeroen Wenting
Ranch Hand
Posts: 5093
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by David O'Meara:

Yes and no. The new window should automatically take up the existing session, but there is a bug in Internet Explorer (v5?) where it creates a new session for the pop-up window. You can use url rewriting to force the second window to take up the existing session.
Dave


No there's not
There's a bug in some versions of Netscape where a new window will be a separate process thus a new session, not in IE (at least not in any 5.x or 6.x version, maybe in very old ones).
I've been programming against IE for years (since about 1999) and never encountered any problems.
 
Anna Hays
Ranch Hand
Posts: 131
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It could be using cookie to keep your session id. IE don't seems like share cookies between browsers. Well IE does that to me but not Netscape and Mozilla when I use cookies based authentication.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic