• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Waiting screen : How -to ?

 
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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

reply
    Bookmark Topic Watch Topic
  • New Topic