Вопрос

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

Это было полезно?

Решение

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);
}
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top