I'm implementing a functionality where I've two navigation paths.
One, the user may wish to start over and key in new data.
Secondly, the user might need to edit the existing criteria.
In the action mapping, i've defined the form bean scope as session. This helps if the user wants to edit the criteria. But when the user wants to start over, still the old values are retained. How do i make the form bean reset when the user starts over? The values should be retained when he wants to edit.
Any ideas/suggestions would be deeply appreciated...
Joined: Jul 21, 2004
Implement an dispatch action with two actions new and edit in your case and write the code correspondingly.
Joined: Oct 14, 2004
well, when you want to startover, call the reset() in the ActionForm so that all for variables are reset to the default value.
Of course, in the reset(), you need to have implementation to reset all the values ... [ August 22, 2005: Message edited by: Mohen Vijay ]
Joined: Oct 27, 2003
You don't even need to write 2 actions, depending on the behavior selected say 2 links calling same action. Depending on the parameter sent you populate the form or not. and call the jsp.