Reputation: 3479
Situation:
How can I prevent that behaviour?
Upvotes: 0
Views: 1160
Reputation: 1108577
Two ways:
Use ajax to execute the action (this doesn't generate browser history).
<h:commandButton ...>
<f:ajax execute="@form" render="@form" />
</h:commandButton>
Send a redirect after post (known as POST-Redirect-GET pattern).
public String save() {
// ...
return "sameview?faces-redirect=true";
}
Upvotes: 2