Hi!
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.
Cheers,
-hendrik
- - - - - - - - - - - - - - - - - - - - - - - - - - -
The WebApp Framework http://www.webapp.de/
jo! small&smart 2.1 servletengine
Persistence objectrelational mapping
Java Server & Servlets The German servlet book
Jon Baer wrote:
> Hi ...
>
> I need to do something and Im confused about running the Date object in
> a servlet I have. I need to drop the Date.getTime() long as the cookie
> and pick it up at a later time and compare it with the current
> Date.getTime() long. How would you go about this?
>
> *Or (better phrased question)*
>
> Is there a way to measure time in seconds that it takes from one person
> to access one servlet and then another. Example:
>
> /servlet/ServletOne (would drop cookie)
> /servlet/ServletTwo (would pick up cookie and compare) -> int (15
> seconds have passed)
>
> Thanks.
>
> - Jon
>
> =-=-=-=-=-=-=-=-=-=-=-=-=-=-
> Jon Baer / MTV Networks
> 1515 Broadway - 29th Floor
> New York, NY 10036
> T. 212-846-5984
> F. 212-846-1801
> E. [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
___________________________________________________________________________
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