Servlet problem with Tomcat 4.0.4
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   IVAN_VENUTI
Posted On:   Wednesday, October 22, 2003 08:55 AM

L675FoServlet Hello, I have a servlet that generates a PDF document. The generation task is quite long, so I have decided to do it in an asyncronous way: the servlet receives the request of generating the document and outputs a "waiting" HTML page that submit a request to the servlet, after a predefined lap of time (using a javascript "setTimeout" function), asking if the document is ready: window.setTimeout("window.location.href = 'http://...servlet URL with parameters';", 15000); ]]>]]> If the document is ready it is presented to the user else the servlet generates another HTML page wit   More>>
L675FoServlet

Hello,


I have a servlet that generates a PDF document. The generation task is quite long, so I have decided to do it in an asyncronous way:


the servlet receives the request of generating the document and outputs a "waiting" HTML page that submit a request to the servlet, after a predefined lap of time (using a javascript "setTimeout" function), asking if the document is ready:



			











If the document is ready it is presented to the user else the servlet generates another HTML page with the same lap of time of the previous HTML page


Everything works nice with Netscape (4.7).
The problems arise with MS Explorer (tested with versions 5.0, 5.5 or 6.0).


Testing the application we notice that:


1) The servlet generates the first HTML waiting page correctly
2) The first invocation of the subsequent page fails to be activated after the predefined amount of time but is waiting until the completation of the generation of document from the servlet


So we decided to comment out the setTimeout function and to put an HTML button:


			














when the user pushes it the page should make another invocation.
This doesn't happend until the completation of the document.
Most strange if the user clicks two times, the second invocation has effect immediatly, but finally, when the document is generated, fails to retrieve it because someone else seems to be listing for it (maybe is the first invocation hanging up?).
We are using Tomcat 4.0.4.


Please help me if someone can imagine a possible solution.
Thanks in advance

   <<Less

Re: Servlet problem with Tomcat 4.0.4

Posted By:   Jerry_Lampi  
Posted On:   Wednesday, October 22, 2003 03:01 PM

I'd scrape the JavaScript and using a META tag:






This example shows a 15 second delay. Basically, the META tag will refresh the page without relying on JavaScript.


The meta tag goes immediately below the Title tag. You can have multiple META tags (you may very well have one in your problematic page similar to: already).

About | Sitemap | Contact