On Tue, 7 Sep 1999, Duke Martin wrote:

> hi,
>
> is it possible to detect when a user clicks the "Refresh" button on
> their browser from within a servlet?  if so, how?

The answer here is related to something I posted a week or so ago in
regards to a question about detecting/stopping someone from pressing
the "Back" button.

That is, pressing the "Refresh" (or "Reload") button is pure
client-side (i.e. browser) functionality, and you can't detect that on
the server.  However, the result of this action -- the re-requesting
of a URL -- you may be able to detect.  You can simply set up your
servlet to tell when someone re-requests the same URL.  Depending on
exactly what you're trying to do, you may only be interested in when
this happens twice in a row (e.g. someone could click on some link,
then use "Back" to get back to a previous URL; whether you want to
handle that differently than someone just pressing "Refresh" is up to
you).  You will probably need to store something in the session to
handle this.

Milt Epstein
Research Programmer
Software/Systems Development Group
Computing and Communications Services Office (CCSO)
University of Illinois at Urbana-Champaign (UIUC)
[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