"Ssemwogerere, Joseph" wrote:

> I am using jrun and would like to be able to warn the user that the session
> is about to expire and gracefully lead them to the start page once it has
> expired.  Has anyone implemented something similar or can someone lead me to
> where I might find a solution.
> Joe.
>

While the user is looking at the page, there isn't any connection between the
server and a host.  I suppose you could implement some sort of count-down
counter in a JavaScript function included on each page that popped up a window
when the time limit was approaching.  Alternatively, you could investigate some
sort of "web-push" approach where a second window had a meta-refresh setting to
keep asking how much time is left (but this is going to create lots of network
traffic).

For leading them to the login page, this is what I do in each servlet (and JSP
page)

* Call request.getSession(true) to create a new session if the old one expired
* Check for the existence of a particular object in the session (which
  will not be there in a new one, obviously).
* Use a RequestDispatcher.forward() call to redirect the user to
  the login page if the object is not there.
* In the login-accepting logic that validates the user, store an object
  in the session for other servlets to check.

Craig McClanahan

___________________________________________________________________________
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