This week's giveaway is in the EJB and other Java EE Technologies forum. We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line! See this thread for details.
We have a scenario wherein after submitting the form an update operation takes place in the database and the user is displayed with the same page.
But this time, the form values have to be reset and displayed afresh so that the user can enter further values and add it to the database.
Looking at this consequence, the reset() method in the ActionForm has to be called explicitly as it is called after the form is submitted and before the bean is populated with the request parameter values. That is very fine. But what we need is the form has to be reset during the page loading the next time.
Can we call the reset method in the Form bean and invoke it in the Action class once our database updating operation is done? I think it is somehow not a better way as its like life cycle method which is supposed to be handled by the Struts framework.
Other alternative is to mimic the reset() method in a separate method and invoke it in the Action class which could clear the required fields.
What is the best way out of these two? is there any other better way to handle this scenario?
Thanks in advance! [ May 14, 2008: Message edited by: Raghavan Muthu ]