The reset() method gets called before the setters are called.
Joined: Nov 24, 2004
Thanks for the response!
in the application I have I have a big list of notifications which I get from database and post it to the jsp as 10 notifications per page. In my action form I implemented reset method to reset the boolean properties of the notifications which are represented as checkboxed on the screen.
The reset method is called twice!!! It is called before setting the data to the action form and after setting it. Hence I never have the updated proeprties on my screen.
I wonder if anyone had this kind of situation.. Please help me!
For a single Action, Struts will only call reset() once just before it calls the setters.
Are you doing "action chaining"? If so, that may cause it to get executed twice, because you're actually calling two different actions.
For example, suppose you have an "initPage" and a "processPage" action, both of which are defined to use the "myForm" ActionForm. If, in the Action class for processPage you then forward to "initPage.do", the reset method for myForm will execute twice: Once before calling the "processPage" action, and once before calling the "initPage" action.
You can solve this problem by not using action chaining.
I'm not sure if this is the problem you're experiencing or not, but it's one possibility.