You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Andrew Geery <Ge...@doc.state.sc.us> on 2002/07/29 20:57:32 UTC

how to detect when the user presses the stop button

I was looking through the struts archive and I've seen this question asked
but never answered.

See http://nagoya.apache.org/eyebrowse/ReadMsg?listId=42&msgNo=30063
for the original question.

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: how to detect when the user presses the stop button

Posted by Tony Baity <to...@yahoo.com>.
On an associated topic...
When someone clicks the browser stop button and the session eventually times out, I have in the past implemented HttpSessionBindingListener on a special class used just for cleaning up the database/ejbs and attached an instance to the session in an overridden ActionServlet when a new session is detected.
Is there another way of doing this... Or something that I have overlooked in Struts.
 "Craig R. McClanahan" wrote:

On Mon, 29 Jul 2002, Eddie Bush wrote:

> Date: Mon, 29 Jul 2002 14:10:45 -0500
> From: Eddie Bush 
> Reply-To: Struts Users Mailing List 
> To: Struts Users Mailing List 
> Subject: Re: how to detect when the user presses the stop button
>
> Yes, it has been answered. The answer is that, assuming the page they
> are waiting to load is printing things out, you will get an IOException
> when you try to send output. AFAIK, this is the only way to detect it.
>

About the best you can hope for is that you *may* get an IOException --
there are no guarantees. Two cases where you definitely won't:

* When the response content is small enough to fit into the
response buffer, and you didn't flush it before returning
from the servlet's doGet() or doPost() method -- the container
might encounter a problem when it flushes, but it's too late
for your application to hear about it.

* When your client is conencted to you via a proxy server (or
something like the Apache-Tomcat web connector), where there
is an intermediary involved -- unless the intermediary is designed
to forward a disconnect notification in some manner that your
servlet container understands (and, for HTTP proxies, there's basically
nothing like this).

This is one of the issues that makes programming web apps quite
interesting ...

Craig


> Andrew Geery wrote:
>
> >I was looking through the struts archive and I've seen this question asked
> >but never answered.
> >
> >See http://nagoya.apache.org/eyebrowse/ReadMsg?listId=42&msgNo=30063
> >for the original question.
> >
> >--
> >To unsubscribe, e-mail: 
> >For additional commands, e-mail: 
> >
>
>
>
> --
> To unsubscribe, e-mail: 
> For additional commands, e-mail: 
>
>


--
To unsubscribe, e-mail: 
For additional commands, e-mail: 



---------------------------------
Do You Yahoo!?
Yahoo! Health - Feel better, live better

Re: how to detect when the user presses the stop button

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Mon, 29 Jul 2002, Eddie Bush wrote:

> Date: Mon, 29 Jul 2002 14:10:45 -0500
> From: Eddie Bush <ek...@swbell.net>
> Reply-To: Struts Users Mailing List <st...@jakarta.apache.org>
> To: Struts Users Mailing List <st...@jakarta.apache.org>
> Subject: Re: how to detect when the user presses the stop button
>
> Yes, it has been answered.  The answer is that, assuming the page they
> are waiting to load is printing things out, you will get an IOException
> when you try to send output.  AFAIK, this is the only way to detect it.
>

About the best you can hope for is that you *may* get an IOException --
there are no guarantees.  Two cases where you definitely won't:

* When the response content is small enough to fit into the
  response buffer, and you didn't flush it before returning
  from the servlet's doGet() or doPost() method -- the container
  might encounter a problem when it flushes, but it's too late
  for your application to hear about it.

* When your client is conencted to you via a proxy server (or
  something like the Apache-Tomcat web connector), where there
  is an intermediary involved -- unless the intermediary is designed
  to forward a disconnect notification in some manner that your
  servlet container understands (and, for HTTP proxies, there's basically
  nothing like this).

This is one of the issues that makes programming web apps quite
interesting ...

Craig


> Andrew Geery wrote:
>
> >I was looking through the struts archive and I've seen this question asked
> >but never answered.
> >
> >See http://nagoya.apache.org/eyebrowse/ReadMsg?listId=42&msgNo=30063
> >for the original question.
> >
> >--
> >To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> >For additional commands, e-mail: <ma...@jakarta.apache.org>
> >
>
>
>
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: how to detect when the user presses the stop button

Posted by Eddie Bush <ek...@swbell.net>.
Yes, it has been answered.  The answer is that, assuming the page they 
are waiting to load is printing things out, you will get an IOException 
when you try to send output.  AFAIK, this is the only way to detect it.

Andrew Geery wrote:

>I was looking through the struts archive and I've seen this question asked
>but never answered.
>
>See http://nagoya.apache.org/eyebrowse/ReadMsg?listId=42&msgNo=30063
>for the original question.
>
>--
>To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>
>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: how to detect when the user presses the stop button

Posted by Tony Baity <to...@yahoo.com>.
This is a browser client and JavaScript question unless you are using an applet with an open connection to your server. You may want to redirect the question to the Mozilla org. The browser folks have not built in detection of those window component events on an individual basis except for general onClose purposes. There might be some tricks you can do with the mouse x and y to determine if the click was out of the regular screen area but this is cowboy hack and may not work for both IE and Netscape.
 Andrew Geery wrote:I was looking through the struts archive and I've seen this question asked
but never answered.

See http://nagoya.apache.org/eyebrowse/ReadMsg?listId=42&msgNo=30063
for the original question.

--
To unsubscribe, e-mail: 
For additional commands, e-mail: 



---------------------------------
Do You Yahoo!?
Yahoo! Health - Feel better, live better