Note to myself:

While using Primefaces we would like the user to click on a button and he should be redirected to another page. This can be done with the following code:


By setting ajax to false we suppress the default use of AJAX and a asynchronous call to the backend. By appending ?faces-redirect=true to the target URL we tell JSF, that it should redirect the user.

The main advantage of a redirection in JSF is, that the URL will be changed. You can also use a FORWARD, but in this case there would not be a change in the users URL.