Win a copy of Microservices Testing (Live Project) this week in the Spring 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

Can a servlet open a new browser window?

 
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!!!
 
Sheriff
Posts: 67650
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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...
 
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 5093
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 131
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic