wood burning stoves 2.0*
The moose likes Servlets and the fly likes Launch a new window from a servlet? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Launch a new window from a servlet?" Watch "Launch a new window from a servlet?" New topic

Launch a new window from a servlet?

Paul Richards

Joined: Jul 25, 2001
Posts: 19
Is it possible to launch a completely new window from a servlet and if so how?
cheers Paul
Angela Margot
Ranch Hand

Joined: Feb 07, 2002
Posts: 80
You could do it in Javascript - or with an anchor/target. This is the html that would open a link a new window
<a href="mywindow" target="_blank">Open Window</a>
There are 4 pre-defined frame targets:
_blank --> Opens page in a new blank browser window
_self ---> Opens page in the same frame where it was called from
_parent -> Opens page in parent frame of where it was called from
_top ----> Opens page on top of all frames

Does this help any??

Angela Margot <img src="smile.gif" border="0"> <br />Sr. Software Engineer<br />SCJP2 SCWCD MCSD MCP
Jim Petersen
Ranch Hand

Joined: Jul 24, 2001
Posts: 241
From above I think you could wrap it in the out.println("...") call but to my mind this seems messy and seems to lead to an unclear separation of role (unclear separation of presentation and control etc)
Just my 2p...

- Jim Petersen <br />SCJP2<br />SCWCD<p>- but then again, I could be wrong...
subject: Launch a new window from a servlet?
Similar Threads
session question
How to by pass pop up blockers while using window,open()
Scope in Struts bean
Testing client crashes
cookies exist when we close browser?