This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Servlets and the fly likes Opening another browser window Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Opening another browser window" Watch "Opening another browser window" New topic

Opening another browser window

Gabriel Cane
Ranch Hand

Joined: Mar 27, 2001
Posts: 39
How would I use either the servlet API or another Java API to open a new browser window from a servlet.
Furthermore, is it possible for servlets to interact with both browser windows interchangibly?

Sun Certified Programmer for the Java 2 Platform
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 60766

Gabriel, servlets operate completely on the server side and cannot directly cause browser actions. What your servlet can do is return javascript in the response that will cause another browser window to open. Or, depending on what your intent is, the URL that activated the servlet on the first place might be directed to a new browser window via a call, or through use of the "target" attribute on a form or anchor tag.

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: Opening another browser window
Similar Threads
session object
IE6 and ServletSession
Lauching browser
New Window
about instance of servlet