HttpSession无法解析为jsf logout中的类型

时间:2012-08-13 06:59:37

标签: jsf-2

无法将HttpSession解析为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";
    }
}

0 个答案:

没有答案