在action中往session存入数据,在拦截器取不出来
struts2吧
全部回复
仅看楼主
level 1
在action中:
HttpSession session = request.getSession();
session.setAttribute("asd", "asdd");
拦截器:
HttpSession session = ServletActionContext.getRequest().getSession();
System.out.println(session.getAttribute("asd"));
输出是null
2015年08月02日 03点08分 1
level 1
解决了,原因是我用java模拟浏览器发送请求时没有上传sessionid这个参数
2015年08月28日 16点08分 6
1