I am trying to retrieve a cookie from a spring controller to a javascript code of a jsp page. This is the controller code
@CookieValue(required = true) String data) {
System.out.println("this is the sound cookie value>>>>>> " + data); //this prints the xyz cookie value to the console
Now in my javascript of a jsp page I am trying to retrieve the cookie this way
var cokdata= "${cookie['data']}";
console.log("value>>>>>>> "+cokdata); //it returns nothing
Please how can I retrieve the cookie value in a javascript code of a jsp page