当前位置: 代码迷 >> Java Web开发 >> 怎么判断session是否过期,解决就给分,再线等
  详细解决方案

怎么判断session是否过期,解决就给分,再线等

热度:34   发布时间:2016-04-17 14:02:17.0
如何判断session是否过期,解决就给分,再线等
如题,我用下面的方法,无效
if(request.getSession(false)==null){
return   mapping.findForward( "error ");
}

------解决方案--------------------
try{
if(session.getAttribute( "employee_no ") == null){
throw new IllegalStateException();
}
}catch(IllegalStateException e){
errors.add( "1013 ", new ActionMessage( "1013 "));
saveErrors(request, errors);
return mapping.findForward( "error ");
}
  相关解决方案