Frage

i use Jsf 1.2 and have navigation rule with redirect, my question is how to add request parameters to view redirected

War es hilfreich?

Lösung

This isn't possible using navigation rules in JSF 1.x. Use ExternalContext#redirect() instead.

public void action() throws IOException {
    // ...

    ExternalContext ec = FacesContext.getCurrentInstance().getExternalContext();
    String url = ec.getRequestContextPath() + "/page.jsf?someparam=" + URLEncoder.encode(someparam, "UTF-8");
    ec.redirect(url);
}
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top