路径:home/testCookieValue
/** * CookieValue映射一个cookie值 * 路径:home/testCookieValue * * @param sessionId * @return */ @RequestMapping("/testCookieValue") public String testCookieValue(@CookieValue("JSESSIONID") String sessionId){ System.out.println("sessionId=" + sessionId); return "home_index"; }
控制台输出:sessionId=5F4930B5AE3AE2F331B1F4A7806F630D