1.在anno.jsp中写个a标签
<a href="anno/testCookieValue">testCookieValue</a>
2.在AnnoController中加入testCookieValue方法
@Controller
@RequestMapping("/anno")
public class AnnoController {
/**
*获取cookie的值
* @param cookieValue
* @return
*/
@RequestMapping("/testCookieValue")
public String testCookieValue(@CookieValue(value="JSESSIONID") String cookieValue){
System.out.println("执行了");
System.out.println(cookieValue);
return "success";
}
}