从内部iframe重定向父/顶级到bean

时间:2014-10-16 10:37:45

标签: jsf redirect iframe jsf-2

我希望能够通过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页面,但不会重定向父页面。我怎么做到这一点?

以下是我引用的其他页面,但没有运气:

0 个答案:

没有答案