I have a problem that I believe has already been solved womewhere but I am not sure how to find the solution or cure it.
When a users session timesout, then they issue a submit. It fails because of an attribute that was in the session is missing. The submit would work if the attributes in the session were refreshed, but I need to know when the session has timed out. How might I save the (html) form they had filled out, have them log in again and then return to that page and issue the same submit?
Thanks for any suggestions. mccools
[ May 26, 2005: Message edited by: Christopher McCauley ]
Originally posted by Christopher McCauley: How might I save the (html) form they had filled out, have them log in again and then return to that page and issue the same submit? [ May 26, 2005: Message edited by: Christopher McCauley ]
Translate the form parameters into a bean on the server and save it in the session. Once you have performed the authorization process, read the bean and pre-populate the form for the user. Does this address the question or was there something else you were looking for?
If I understand the problem, you want to preserve a partially filled out form contents past the expiration of a session. If you keep the contents in a JavaBean type object, where the object implements the HttpSessionBindingListener, the object will get notified when the session is being destroyed. At that point you might serialize the bean to disk or otherwise save the state. Obviously there will have to be some mechanism to recover the bean when they log back in. Bill
Author and all-around good cowpoke
Joined: Mar 22, 2000
If the session never times out and you depend on every user specifically logging out for clean up, you will eventually clog the system with old abandoned sessions.
Joined: Jan 03, 2005
Thank you all, we are using ActionForms (Struts) to back all the forms. I am quite sure I can implement the listener interface to catch the notify(). [ May 27, 2005: Message edited by: Christopher McCauley ]