Un-escape JavaScript escaped value in Java

前端 未结 4 1496
醉梦人生
醉梦人生 2021-01-18 23:05

In our web service we set a cookie through JavaScript wich we read again in Java (Servlet)

However we need to escape the value of the cookie because it may contain i

4条回答
  •  野的像风
    2021-01-18 23:56

    In java you got StringEscapeUtils from Commons Lang to escape/unescape.

    In Javascript you escape through encodeURIComponent, but I think the Commons component I gave to you will satisfy your needs.

提交回复
热议问题