日期:2014-05-18  浏览次数:20806 次

如何判断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 ");
}