• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

New Window

 
Kel Walker
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 231
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 78
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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>
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64958
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
...or, if the post is part of a form submission, the "target" attribute can also be used on the form tag.
hth,
bear
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic