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
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts reset method" Watch "Struts reset method" New topic

Struts reset method

Vivek Alampally
Ranch Hand

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

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.
I agree. Here's the link:
subject: Struts reset method
jQuery in Action, 3rd edition