Leaving the reset() empty solves the problem, my only worry is that AFAIK ActionForm instances are often kept in memory instead of creating new ones for the new requests.
True. In your case, the forms are kept in session and
Struts will reuse one if it is found in session scope.
If this is true, what happens if I call the page a 2nd time, and dont fill a particular field which had value in the 1st request ? Or - apart from checkboxes - the empty value overwrites the old one anyway ?
It will repopulate the
jsp with the value from memory if you are using Struts tags for the inputs. Also, if the textfield is left empty, it will submit "", or empty
string and overwrite the old one.
Meantime I came up with with another possible solution, if you have time, please give your opinion on this: What if I check the session for the User object in the reset() method, and do the cleaning up accordingly ? (Between the 2 pages of user creation the half-ready user object is kept in the session)
Isn't the half-ready user object in the ActionForm??? Why are you storing incomplete data in two places - both the form and as a separate session User object?
[ September 28, 2004: Message edited by: Marc Peabody ]