How are people handling session timeout/invalidations in their servlets?

For example, my JSP includes several beans including a bean that helps the
page maintain state, such as when updating a user's profile.  The user's
profile is stored in a bean by a servlet, and the JSP uses that bean to fill
out the HTML form.

If the user then walks away and the session expires, then comes back and
tries to update that profile, my POSTed servlet has a problem.  It does not
have a session that expects.  Sure, it can recreate the session and even the
same session-related objects and store them back in the session object via
putValue(), but the newly created objects do not contain the state that the
user had on his screen.

What do most people do in this case?  I found that throwing a
ServletException causes my Explorer 5 to show its standard "problem page,"
(it does not show my ERRORPAGE, probably because the JSP successfully drew
that page earlier, and it does not show an exception page like the old JRun
did).  I could send them back to the page from which they came, but that
could be confusing since they will have lost their state and there won't
really be any error message or anything.  I could show them a special error
page by sendRedirect() within the servlet.  I could....well you get the
idea.

What's considered the best way to do this among the web development/user
community?

Thanks,
David

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JSP-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to