Well I was actually just figuring on doing a single servlet to do all of
this and the Session.getLastAccessedTime() does work. Dumb question thought
is how I would actually do the comparing now?
long Session.getLastAccessedTime()
-
new Date().getTime()
How do you do the math between the two to get the seconds?
- Jon
-----Original Message-----
From: Hans Bergsten [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 19, 1999 12:31 PM
To: [EMAIL PROTECTED]
Subject: Re: Comparing Milliseconds w/ Servlets
Hendrik Schreiber wrote:
>
> Try to establish a session with HttpServletRequest.getSession(true),
access
> this session in your servlet B and then ask for
> HttpSession.getLastAccessedTime() and compare that with the current time.
> But be carefull: when you access in your servlet B you have to make sure
that
> HttpSession.isNew() returns false - otherwise the browser on the other
side
> doesn't support cookies. To work around this you might want to use
URLEncoding.
I'm afraid this doesn't work since the last access time for the session is
reset when the request for servlet B is received, before servlet B even gets
a chance to look at it.
I suggest putting an application specific Date object in the session and use
for this type of comparison.
--
Hans Bergsten [EMAIL PROTECTED]
Gefion Software http://www.gefionsoftware.com
___________________________________________________________________________
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
___________________________________________________________________________
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