Different scenarios require different approaches. You can reset the bean and page By creating a loadSomething() method this will be called after the bean is constructed and and then will forward the page to itself
Public String Reset(){
YourSessionBean = new YourSessionBean();
YourBean.loadSomething();// this method will set all your default values
Return “Page_u_are_On”;
This will do a total page refresh with new values
Now if You using partial page rendering say with a changeValueListener or action method I will Bind the component and reset the values in the java code also so that the page and bean are refreshed(but not the whole page)
Class Abc{
HtmlInputText xComponent;
String testComp;
//I can do this in an action
public void Reset(){
YourSessionBean = new YourSessionBean();
YourBean.loadSomething();
xComponent.setValue(“anyvalue”);
}
public HtmlInputText getXComponent() {
return xComponent;
}
public void setXComponent(HtmlInputText component) {
xComponent = component;
}
public String getTestComp() {
return testComp;
}
public void setTestComp(String testComp) {
this.testComp = testComp;
}
This is
JSP /or XML Page
<t:inputText binding=”#{abc.xComponent}” value="#{abc.testComp}"/>
The init method will only work if the default values do not affect any of the Component on the JSF page