But if you change your approach of showing "work in process" label, while the report is being generated, to this one, both your problems get solved.
"write some _javascript_ that will show a layer which is opaque in the browser, and let that layer show some text like 'processing...' in blinking mode. invoke this function onSubmit event of your screen. The report gets fired at the server side and when it gets generated it send response to the browser"
the advantages of this approach are
1. You avoid one network round trip ( which is a primary focus for architects of remotely accessible applications, that have high network latency)
2. There is no flag at the server side therefore half complete reports get completed and those are not sent anywhere and does not cause any problem.
do u think it can work for u ?
Regards,
Puneet Agarwal
Tata Consultancy Services
Mailto: [EMAIL PROTECTED]
Website: http://www.tcs.com
"Jim Barrows"
<[EMAIL PROTECTED]>
07/23/2004 05:03 AM
|
|
> -----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]
ForwardSourceID:NT00002806
DISCLAIMER: The information contained in this message is intended only and solely for the addressed individual or entity indicated in this message and for the exclusive use of the said addressed individual or entity indicated in this message (or responsible for delivery of the message to such person) and may contain legally privileged and confidential information belonging to Tata Consultancy Services. It must not be printed, read, copied, disclosed, forwarded, distributed or used (in whatsoever manner) by any person other than the addressee. Unauthorized use, disclosure or copying is strictly prohibited and may constitute unlawful act and can possibly attract legal action, civil and/or criminal. The contents of this message need not necessarily reflect or endorse the views of Tata Consultancy Services on any subject matter.] Any action taken or omitted to be taken based on this message is entirely at your risk and neither the originator of this message nor Tata Consultancy Services takes any responsibility or liability towards the same. Opinions, conclusions and any other information contained in this message that do not relate to the official business of Tata Consultancy Services shall be understood as neither given nor endorsed by Tata Consultancy Services or any affiliate of Tata Consultancy Services. If you have received this message in error, you should destroy this message and may please notify the sender by e-mail. Thank you.
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]