I'm using the following action method to make a redirect to the same page.
public String localeAction()
{
String viewId = FacesContext.getCurrentInstance().getViewRoot().getViewId();
return viewId + "?faces-redirect=true";
}
This method is called, when a value from a <p:selectOneMenu>
holding a list of different languages is selected on the master template.
If the current page URL has some query-string parameters appended to it like so,
http://localhost:8080/Project/public_resources/ProductDetails.jsf?id=5
The parameter id
is lost after this redirection has been made.
Is there a way to redirect to the current page along with all query-string parameters intact - they should not be lost?