添加时编码,读取是解码,否则编译不过

    Cookie cookie=new Cookie("姓名","黄嘎兵");
    respose.addCookie(cookie);

编译不过

要这样做

    Cookie cookie=new Cookie(URLEncoder.encode("姓名"),URLEncoder.encode("黄嘎兵"));
    response.addCookie(cookie);
                String cookieName=URLDecoder.decode(cc.getName());
                String cookieValue=URLDecoder.decode(cc.getValue());

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-11-25
  • 2022-01-03
  • 2021-08-18
  • 2022-12-23
  • 2021-10-07
猜你喜欢
  • 2021-07-05
  • 2022-01-06
  • 2021-06-03
  • 2021-09-02
  • 2021-05-01
  • 2021-06-28
相关资源
相似解决方案