0

Am setting a cookie like below, in one jsp page.

document.cookie = cookieName + "=" + escape("#{myBean.cookieValue}");

And am retrieving cookie value in my target jsp page using request.getCookies();.

Am getting the value of cookie in my target jsp page. But, the value being set in the cookie contains space like 31st July 2012. So, when I print this cookie value in my target JSP page, am getting 31st%20July%202012.

In my target JSP page I just want to show the exact initial value like 31st July 2012.

How can I achieve this?

Prakash K
  • 11,669
  • 6
  • 51
  • 109
Vikas V
  • 3,176
  • 2
  • 37
  • 60
  • possible duplicate of [unEscape JavaScript escaped value in JAVA](http://stackoverflow.com/questions/882036/unescape-javascript-escaped-value-in-java) – mplungjan Jul 31 '12 at 05:55
  • yes, probably - all you need is to use the java equivalent of unescape() when you print the cookie value. – gengkev Jul 31 '12 at 06:09
  • Finding it difficult to use unescape() in a scriplet. `<% String cookieValue = ""; String actualValue = ""; ... cookieValue = cookie.getValue(); actualValue = **unescape**(cookieValue); %> It says "The method unescape(String) is undefined for the type (Name of my jsp page)" – Vikas V Jul 31 '12 at 07:06

0 Answers0