This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Like so many other cases, this is something that shouldn't be done using JSF-specific code. In fact, my #1 rule for JSF is that the more JSF-specific the code is, the more likely it is that it's being done wrong.
Instead of mucking around with JSF's internal bean management, write an init() method that clears all of the bean's property values in a POJO way. I invoke this method in the constructor so that the same initial state (values) is created when the bean is first constructed, so both the constructor and the reset() method would invoke init().
If reset() is an action method invoked from the corresponding View, then the normal JSF lifecycle view-update processing will reset the values on the displayed form (to the values that init() set).
Note that you should not use a JSF "reset" button control to invoke the reset() method, since that control generates an HTML RESET control, which restores the values to their initial page-load settings on the client side without invoking any server-side code. Including the reset() method.
An IDE is no substitute for an Intelligent Developer.
Joined: Feb 02, 2012
Thanks for reply. My problem is solved now . I called same page directly by using action="mypage" attribute.