• Post Reply Bookmark Topic Watch Topic
  • New Topic

how can a servlet send response to a new window  RSS feed

 
harsha karuturi
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am creating cash counter application. i want to generate a pdf receipt in new window and print it.

i am using jsp to take input from user and servlets to process the input.

i am able to generate a pdf but in same page. i want it to be a popup menu.

do any one have an idea how to implement it?
 
J. Kevin Robbins
Bartender
Posts: 1801
28
Chrome Eclipse IDE Firefox Browser jQuery Linux MySQL Database Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The only way I know is to use JavaScript. You might find this page useful.

Links can be opened in a new window using "target="blank"". but I don't think it can be done from the server side.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66154
146
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A response will always be sent to the same window for which the request was generated. For example, you can submit the request for the PDF to an invisible iframe if you don't want to disturb the displayed page.
 
K. Tsang
Bartender
Posts: 3648
16
Firefox Browser Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Or you can use the target attribute in the html form tag

 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66154
146
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The problem with that approach is that it will open a blank page. I find that annoying and disruptive.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!