File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
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: 63839

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] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: Opening another browser window
jQuery in Action, 3rd edition