I need to create a PDF file dynamically
using the data from the database, it might take from 5 sec to 10 min. Meanwhile, I don't like to wait idle, any solution?
any help appreciated!!
-
how to asynchronously create a PDF in web application? (3 messages)
- Posted by: Robert Strong
- Posted on: November 30 2004 11:44 EST
Threaded Messages (3)
- how to asynchronously create a PDF in web application? by Scott Carlson on November 30 2004 13:15 EST
- how to asynchronously create a PDF in web application? by Robert Strong on November 30 2004 14:30 EST
- how to asynchronously create a PDF in web application? by Rob Beardow on November 30 2004 20:07 EST
-
how to asynchronously create a PDF in web application?[ Go to top ]
- Posted by: Scott Carlson
- Posted on: November 30 2004 13:15 EST
- in response to Robert Strong
I can think of two solutions. One is pure J2EE and the other is a browser trick.
1. Use a Message Driven Bean. Your Web App dumps a message into a queue which is processed async.
2. Have your web page call to the server using an XMLHttpRequest. This can be done so that it looks asynch, but is still synchronous from the web app. -
how to asynchronously create a PDF in web application?[ Go to top ]
- Posted by: Robert Strong
- Posted on: November 30 2004 14:30 EST
- in response to Scott Carlson
for your first solution, if I use a MDB to process the message and generate a PDF file, how could I notify the web application that "the PDF is created, please display it"?
thank you for your help!! -
how to asynchronously create a PDF in web application?[ Go to top ]
- Posted by: Rob Beardow
- Posted on: November 30 2004 20:07 EST
- in response to Robert Strong
We do exactly this in our application. We have 2 options for the user:
User requests PDF generation servlet.
Servlet flushes HTML 'waiting' message to user (while still generating).
When PDF is ready, PDF file is written to unique URL and final flush to browser includes meta-refresh to new unique URL.
Client gets first response flush 'waiting' message, second response flush redirect to finished file.
The other option is for users to request PDF document generation and be notified by email when the document is complete.
The email provides the unique URL to access the PDF.