HttpSession cannot be resolved to a type in jsf logout

不打扰是莪最后的温柔 提交于 2019-12-23 04:52:22

问题


HttpSession cannot be resolved to a type in jsf logout

public class LogoutBean 
{

   public String Logout() 
    {
//      FacesContext context = FacesContext.getCurrentInstance();
//      ExternalContext ec = context.getExternalContext();
// 
//      final HttpServletRequest request = (HttpServletRequest)ec.getRequest();
//       request.getSession( false ).invalidate();


        ((HttpSession) FacesContext.getCurrentInstance().getExternalContext().getSession(false)).invalidate();

         return "login";
    }
}

来源:https://stackoverflow.com/questions/11929508/httpsession-cannot-be-resolved-to-a-type-in-jsf-logout

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!