@CookieValue使用方法同@RequestParam使用方法一致(接收普通参数)
@RequestMapping(value = "show17")
public String test17(Model model, @CookieValue("JSESSIONID") String cookie) {
model.addAttribute("msg11", "springmvc接收cookie : " + cookie);
return "hello3";
}
<%--
Created by IntelliJ IDEA.
User: U100926
Date: 2022/08/31
Time: 15:31
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page isELIgnored="false" %>
<html>
<head>
<title>Title</title>
</head>
<body>
${msg11}
</body>
</html>