1.概述
@CookieValue可让处理方法入参,绑定某个Cookie值;
2.代码测试
testCookieValue@RequestMapping("/testCookieValue") public String testCookieValue(@CookieValue("JSESSIONID")String sessionid){ //Cookie:JSESSIONID=891E99BCA3935B7A24842A1C04A3594B System.out.println("SpringMVCTest.testCookieValue()"+sessionid); return SUCCESS; } 结果:SpringMVCTest.testCookieValue()67F2AFA2D22E9B256B161EE0979E0344