请教一下,有谁知道在MyBatis拦截器 中,怎么获取HttpSession吗?我想在拦截器中拿到session中的一个值。

伤你 2020-11-30 05:05:13
请教一下,有谁知道在MyBatis拦截器 中,怎么获取HttpSession吗?我想在拦截器中拿到session中的一个值。
...全文
4806 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
强大的农民 2020-12-02
  • 打赏
  • 举报
回复
HttpSession session = ((ServletRequestAttributes)RequestContextHolder.getRequestAttributes()).getRequest().getSession();
伤你 2020-11-30
  • 打赏
  • 举报
回复
这个方法可以使用。
伤你 2020-11-30
  • 打赏
  • 举报
回复
HttpSession session = ((ServletRequestAttributes)RequestContextHolder.getRequestAttributes()).getRequest().getSession();

81,095

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧