• Post Reply Bookmark Topic Watch Topic
  • New Topic

general questions  RSS feed

 
Bashar Ayyash
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,

I build a servlet that generate Excel document I call it from a jsp page by clicking a button and the result displayed in the same page, I want to call the servlet by clicking a button on the jsp page and display the result in a new jsp page not the page that contains the button.

regards,
 
Jeanne Boyarsky
author & internet detective
Sheriff
Posts: 37256
519
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you were using a link instead of a button, you would open a link in a new window using:
<a TARGET="_blank href="...

Since you are using a form/button, you need to use Javascript:
window.open(...);
 
ak pillai
author
Ranch Hand
Posts: 288
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you still want to use the same browser instance, you can also use a RequestDispatcher to forward to a different page from your servlet.

But if you want to use a new broser instance, use a target attribute.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!