且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何从 JSF 中的 managedBean 重新加载同一页面?

更新时间:2023-12-04 16:52:40

Just 重定向请求 URI.

public void login() throws IOException {
    // ...

    ExternalContext ec = FacesContext.getCurrentInstance().getExternalContext();
    ec.redirect(((HttpServletRequest) ec.getRequest()).getRequestURI());
}