Sending a redirect from inside an ajax listener method Sending a redirect from inside an ajax listener method ajax ajax

Sending a redirect from inside an ajax listener method


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();}


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";