特牛生活网

SpringMVC~获取Cookie/Session/header、返回请求参数(text/html、Json对象、静态页面xxx.html、请求跳转/重定向)_request.getcookies()_Salute-Y的博客-CSDN博客

网友收藏
  • 链接地址:https://blog.csdn.net/Merciful_Lion/article/details/124345312
  • 链接标题:SpringMVC~获取Cookie/Session/header、返回请求参数(text/html、Json对象、静态页面xxx.html、请求跳转/重定向)_request.getcookies()_Salute-Y的博客-CSDN博客
  • 所属网站:blog.csdn.net
  • 被收藏次数:1168
文章浏览阅读3k次,点赞32次,收藏24次。文章目录Cookie获取方法1:通过request和response对象获取方法2:使用注解(更简单、快速)Session储存Session:读取Session:header返回参数Cookie获取方法1:通过request和response对象通过调用HttpServletRequest和HttpServletRespon对象的getCookies和getSession方法.获取Cookie: @GetMapping("/getCk") public Cookie[] getCooki_request.getcookies()