File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
JavaRanch » Java Forums » Java » Servlets
Bookmark "New Window" Watch "New Window" New topic

New Window

Kel Walker

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:'')
Irene Loos
Ranch Hand

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

Irene Loos
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63869

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

[Asking smart questions] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: New Window
It's not a secret anymore!