*
The moose likes Servlets and the fly likes New Window Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "New Window" Watch "New Window" New topic
Author

New Window

Kel Walker
Greenhorn

Joined: Apr 04, 2002
Posts: 19
I have a jsp with a html form that posts directly to a servlet. The servlet processes the data, and will then forward to a second jsp to display the results.
I want the results jsp to be opened in a new browser window. Can someone please advise the best way to do this?
Thank you.
Juanjo Bazan
Ranch Hand

Joined: Feb 04, 2002
Posts: 231
Just use a javascript function in your first jsp, to load the servlet response into another browser window...
something like this:
window.open('http://www.server.com/servlet?params')
Irene Loos
Ranch Hand

Joined: Apr 15, 2002
Posts: 78
You can also use parameter target="_blank" in you anchor tag. Like:
<A href="http://www.yoursite.com/yourNewPageName.jsp" target="_blank"> Name of the link </A>


Irene Loos
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61092
    
  66

...or, if the post is part of a form submission, the "target" attribute can also be used on the form tag.
hth,
bear


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: New Window