1. private HttpServletRequest request;
request=ServletActionContex.getRequest();
HttpSession session=request.getSession();
User loginUser=session.getAttribute("loginUser");//得到登陆用户
if(null==loginUser||loginUser.equals(null)){
this.addFieldError("loginerror","您还没有登录或者登录已经超时!");
return LOGIN;
}
2.
Map session=ActionContext.getContext().getSession();
User user=(User)session.get("loginUser");
if(null==loginUser||loginUser.equals(null)){
this.addFieldError("loginError","您还没有登录或者登录已经超时!");
return LOGIN:
}