This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
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

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...
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: Launch a new window from a servlet?
It's not a secret anymore!