两步骤搞定:

1,修改tomcat的server.xml

<Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443"/>

增加字段 useBodyEncodingForURI="true" URIEncoding="UTF-8"

2,servlet 中设置编码方式

request.setCharacterEncoding(Encodings.UTF8.value);

相关文章:

  • 2021-09-30
  • 2021-09-27
  • 2022-12-23
  • 2022-12-23
  • 2021-12-11
  • 2022-12-23
  • 2022-12-23
  • 2021-07-23
猜你喜欢
  • 2021-12-04
  • 2022-12-23
  • 2022-12-23
  • 2021-12-21
  • 2021-08-01
  • 2021-11-23
  • 2022-01-18
相关资源
相似解决方案