struts使用session 通过

  1,Map<String, Object> map=ActionContext.getContext().getSession();

map.put("username", username);

推荐使用这种方式


2ServletActionContext.getRequest().getSession();