Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Struts : How to reset ActionForm bean properties

843836Nov 28 2004 — edited Aug 9 2006
Hi 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
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 6 2006
Added on Nov 28 2004
4 comments
210 views