Sending a redirect from inside an ajax listener method

前端 未结 2 941
一生所求
一生所求 2020-12-11 02:34

This question is closely related to this one (which has been answered).

Throughout my project, I navigate between screens using JSF command buttons, where the action

2条回答
  •  旧时难觅i
    2020-12-11 03:07

    You can redirect the response from the backing bean:

    public void clickFlight(Item lowFareBundledSearchItem) throws IOException {
        // ...
        FacesContext.getCurrentInstance().getExternalContext().redirect("selected-flight-review.xhtml");
        FacesContext.getCurrentInstance().responseComplete();
    }
    

提交回复
热议问题