I have two scenario
I have two actions which have logic in bean like
My buttons
<h:commandButton value="Submit" action="#{bean.test}" />
<h:commandButton value="Submit" action="#{bean.testOne}" />
This are the two commnadButtons and there logic in bean
public void test() {
log.info("I m in test");
}
public void testOne() {
log.info("I m in testOne");
try {
FacesContext.getCurrentInstance()
.addMessage("", new FacesMessage("Record Saved successfully."));
FacesContext
.getCurrentInstance()
.getExternalContext()
.redirect(
FacesContext.getCurrentInstance()
.getExternalContext().getRequestContextPath()
+ "/cycle/page");
} catch (IOException e) {
log.error(e.getMessage());
}
}
When I am going to click on 1st button (test action) that time jsf life cycle goes to every phase like
restore view
Apply request values
Process validation
update models
invoke application
render response
But when I click on testOne button that time jsf life cycle skip render response after invoke application like
restore view
Apply request values
Process validation
update models
invoke application
restore view
render response
In simple language When I am navigate the page through facesContext that time jsf skips that phase.
But why this happens? I am not getting the problem.