> akashmaheshwari wrote:
> >         i am wondering how do i know that some body had
> >         clicked stop button on browser.
>
> The short answer is you can't. The slightly longer answer is that the browser
> does not send any request to the server when the user clicks stop. So, your
> servlet is not notified at all when this occurs. However, when the user clicks
> the stop button, an exception will be thrown when your servlet attempts to write
> to the output stream. You can catch the exception and deal with it at that
> point. The exception that is thrown is an "IOException: Broken Pipe."

     You might also add a bit of javascript to the link or form that
invoked your servlet.  This would be a function tied to onError and/or
onAbort events, that would invoke another servlet.  Note that
depending on how sophisticated you want the reactoin to get, this can
quickly get annoyingly complicated and run into browser dependencies.

     For example, to make the invocation to the servlet happen, you
have to load a page, and if you don't want that page to load to the
user's current browser window, then you have to have it load somewhere
else, and this probably means you have to set that somewhere else up
ahead of time, maybe as an invisible frame.  All of this is a good
reason to avoid javascript in the first place, but...

     It'd be really nice if there was some widely compatible
javascript technique to simply have a javascript function invoke a URL
with some arguments and put the results into a variable.  Then again,
it would be really nice if javascript were a sane programming
language.  Sigh.

Steven J. Owens
[EMAIL PROTECTED]
[EMAIL PROTECTED]

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to