aspose file tools*
The moose likes Servlets and the fly likes Waiting screen  : How -to ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Waiting screen  : How -to ?" Watch "Waiting screen  : How -to ?" New topic
Author

Waiting screen : How -to ?

Stefan Geelen
Ranch Hand

Joined: Nov 19, 2001
Posts: 49
Hi,
I have following problem:
1) A user clicks on a button to call a servlet that will generate a .pdf document.
2) In the mean time a window is opened that displays a waiting message.
3) When the .pdf document is ready the 'waiting' window should be closed and a new window should be opened where the .pdf is displayed.
Now, after spending a day on this issue I have following:
1) On a form I have a small Javascript that opens a new window and calls the servlet (window.open(http://server/servlet/testservlet, windowname)
2) The servlet sends the waiting message to this window . In the mean time a separate thread is started to generate the pdf.
3) This waiting window checks every three seconds if the thread is ready (using: response.setHeader("Refresh", "3");
Now the problem I have is that:
1) When the .pdf is ready the servlet should close the waiting window, open another window and send the .pdf document to it.
The probmem is that I need to set two response.setContentType , once text/html to close the first window and open another (?) and once application/pdf to send the pdf

Anyone any idea ?
Stefan

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Waiting screen : How -to ?