报错问题org.springframework.web.bind.MissingRequestCookieException: Required cookie ‘_ga’ for method parameter type String is not present
报错原因:
尚硅谷雷神SpringBoot2的第29节请求处理-常用参数注解使用@CookieValue("_ga") String _ga
,然后就报错如下
解决报错
然后发现原来是我的请求头里头没有_ga
,只有Idea-824fee1d
- 这是老师的
- 这是我的
然后把代码改成@CookieValue("Idea-824fee1d") String _ga
,就OK了