在Servlet或者是在Struts1中获取当前用户的Session方法是:
HttpSession session = request.getSession(true);
注意:request的类型是:HttpServletRequest.
如果是在Struts2中的Action中获取Session.方法是:
Map session = ActionContext.getContext().getSession();
在java的Servlet中获取session的方法是:
HttpSession session = request.getSession(true);
public void doGet(HttpServletRequest request, HttpServletResponse respose){
HttpSession session = request.getSession();
}