Action添加session 在HttpServlet 中获取不到session 中的值

elvn2 elvn2 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
在登录Action 中我设置session 值.


ServletActionContext.getRequest().getSession().setAttribute("email",
this.email);



而在 HttpServlet 请求中获取 email 的值一直为null

String email3 = (String) ServletActionContext.getRequest()
.getSession().getAttribute("email");


ActionContext.getContext().getSession().get("email");



这二个都试了,还是不行。望高手指点。
...全文

相关推荐

评论 3
收藏 已收藏
分享
返回顶部
elvn2
Web 开发 81,108 成员 341,721 内容