[code="java"] public String logoff() throws Exception {
HttpSession session = request.getSession(false);
session.removeAttribute("SE_SEIMEI");
session.removeAttribute("SE_MAIL");
session.removeAttribute(update_date);
session.invalidate();
id = null;
mail = null;
return "logoff";
}[/code]
[code="java"]
if (null == session)
{
return "logoff";
}
session.removeAttribute("SE_SEIMEI");
session.removeAttribute("SE_MAIL");
session.removeAttribute(update_date);
session.invalidate();
[/code]
读取属性的时候报空指针吗?你在用它之前判断一下是否null 是的话(session超时、注销等) 你就给他跳转到登陆页面不就行了