File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

Waiting screen : How -to ?

Stefan Geelen
Ranch Hand

Joined: Nov 19, 2001
Posts: 49
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 (, 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 ?

I agree. Here's the link:
subject: Waiting screen : How -to ?
It's not a secret anymore!