Struts : How to reset ActionForm bean properties
843836Nov 28 2004 — edited Aug 9 2006Hi all,
I have a DynaValidatorForm bean which contains properties that maps to drop downs and some texboxes in the JSP. I have created 2 actions, one for pre-populating the bean and another for processing the post operation from the jsp. The bean is in session scope under both these actions.
What I need is after the data is captured, I need the users to clear the page with the RESET button. The <html:reset> does not clear the bean properties which means I have to manually reset the values. So what I do is when the reset is pressed, I do an action forward to the PRE_POPULATING action class like..
return mapping.findForward("forward.pre.loadActionForm")
But the values never get initialized. For String properties, I try to initialize it to spaces but the page still shows the previous value in session!.. Is there an elegant way of resetting values for beans that are in session scope??
Many thanks
Clement