Two Laptop Bag*
The moose likes Struts and the fly likes Struts reset method Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts reset method" Watch "Struts reset method" New topic
Author

Struts reset method

Vivek Alampally
Ranch Hand

Joined: Jul 10, 2008
Posts: 67
Hi,
Can anyone please explain why reset() is used in form bean?


Thanks
Vivek Alampally
Kristof Camelbeke
Ranch Hand

Joined: Nov 28, 2001
Posts: 97
As the name suggests this method allows you to reset your form properties....

the api says it all:


Reset bean properties to their default state, as needed. This method is called before the properties are repopulated by the controller.

The default implementation does nothing. In practice, the only properties that need to be reset are those which represent checkboxes on a session-scoped form. Otherwise, properties can be given initial values where the field is declared.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Struts reset method
 
Similar Threads
2 JSP pages using the same form bean
Reseting an applet
problem with k-shell
struts servlet - old Error message on the previous submission has been added to current error messa
how to reset the field after validation using annotations(Struts 2)