> -----Original Message-----
> From: Rizwan Merchant [mailto:[EMAIL PROTECTED]
> Sent: Thursday, July 22, 2004 4:23 PM
> To: 'Struts Users Mailing List'
> Subject: RE: Intermediate loading page
> 
> 
> 
> Thanks for the previous input. I moved the report generation 
> to a thread and
> set a session variable which is a boolean indicating that a report is
> currently being generated. Once the report generation is complete that
> session variable is set to false again. 
> I have come across another problem though. Say a user starts 
> generating a
> report. The boolean session variable is set to true. If the 
> user tries to
> generate another report while the fist oneis not complete, 
> then the boolean
> variable is checked and the user is not allowed to generate 
> another report
> (until the first one is complete and the boolean session 
> variable is set to
> false).
> 
> In this scenario, if the user abruptly closes the 
> intermediate page which is
> supposed to load the report , then the session variable is 
> still set to true
> (indicating report is being generated) as the thread on the 
> server has not
> finished running. If the user now tries to create another 
> report then s/he
> will not be allowed to do so (until the thread on the server is done
> running).
> 
> So I guess my question is : Is there any way to set a session 
> variable when
> the user closes a browser window abruptly? 
> Or is there another way to approach this problem? 
Yes and no.  Since the browser sends no closing informaiton to the server, there isn't 
much you can do... however using HttpSessionListener, you can know when the session is 
destroyed, in the case of the user wandering away, this would be a session timeout... 
you can use the event to get some information from the session, but not necessarily 
the exact cause of the session destruction.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to