我希望能够通过bean重定向顶级/父级xhtml。我在我的bean类中尝试了以下内容:
if (result == 1) {
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_INFO, "You have successfully changed your password. Please log in to continue.", null));
con.close();
FacesContext.getCurrentInstance().getExternalContext().invalidateSession();
return "/index?faces-redirect=true";
}
也
if (result == 1) {
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_INFO, "You have successfully changed your password. Please log in to continue.", null));
con.close();
FacesContext.getCurrentInstance().getExternalContext().invalidateSession();
FacesContext.getCurrentInstance().redirect("/index.xhtml");
return;
}
以上两种方法都会重定向iframe页面,但不会重定向父页面。我怎么做到这一点?
以下是我引用的其他页面,但没有运气: