This week's book giveaway is in the General Computing forum. We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line! See this thread for details.
Aravind Prasad wrote:I am using Jasper Report to export the report to PDF file. After exporing the file, I want the PDF to be opened automatically. I need to do the script in body onload to make it simple.
The simple way to do that is just to write the output to the response and write the appropriate headers to specify that the response is a PDF file and not HTML. It's even simpler if you do it in a servlet and don't have all the JSP overhead confusing things. Especially since JSP is for generating HTML and you don't want to generate HTML.