Is there a way to add a cookie to a method with @ResponseBody annotation?
I am building my web application based on Spring MVC and am facing a problem while trying to add a cookie to my ajax request handling method.
I realized that the method with @ResponseBody (in my example it returns a string value) does not create a "real" response and the added cookies are lost.
Is it possible to add a cookie to a method called via ajax (and hence annotated with @ResponseBody) in Spring MVC?
+3
source to share