JSF ensure
<h:commandXxx action="index.xhtml">
to page forward, and
<h:commandXxx action="index.xhtml?facesredirect=true">
to page redirect.
How to perform these two operations with Javascript?
JSF ensure
<h:commandXxx action="index.xhtml">
to page forward, and
<h:commandXxx action="index.xhtml?facesredirect=true">
to page redirect.
How to perform these two operations with Javascript?
No.
Just send a request to server in such way that the server applies exactly the desired behavior.
E.g.
location = "index.xhtml";
location = "pageWhichRedirectsToOtherPageWhichForwardsToThatPage.xhtml";