Sending a redirect from inside an ajax listener method

前端 未结 2 930
一生所求
一生所求 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条回答
  • 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();
    }
    
    0 讨论(0)
  • 2020-12-11 03:07

    Just add in your backing bean return "selected-flight-review"; You don't need to add (.xhtml) Or if you wanna redirect return "selected-flight-review? Faces-redirect=true";

    0 讨论(0)
提交回复
热议问题