/**
* ログアウト、sessionを削除
* @return
* @throws IOException
*/
public String logOut() {
FacesContext facesContext = FacesContext.getCurrentInstance();
ExternalContext extContext = facesContext.getExternalContext();
HttpServletRequest req = (HttpServletRequest)extContext.getRequest();
HttpSession session = req.getSession(false);
HttpServletResponse res = (HttpServletResponse)extContext.getResponse();
try {
res.sendRedirect("../login/login.jsf");
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
if(session != null){
}
return "success";
}
* ログアウト、sessionを削除
* @return
* @throws IOException
*/
public String logOut() {
FacesContext facesContext = FacesContext.getCurrentInstance();
ExternalContext extContext = facesContext.getExternalContext();
HttpServletRequest req = (HttpServletRequest)extContext.getRequest();
HttpSession session = req.getSession(false);
HttpServletResponse res = (HttpServletResponse)extContext.getResponse();
try {
res.sendRedirect("../login/login.jsf");
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
//指示当前response已产生,JSF应该在当前阶段执行完成后立刻结束整个生命周期
if(session != null){
ExtCmdManager.resultMap.remove(session);
//删除session
}
return "success";
}