第一:code

@RequestMapping(value = "/query/{keyword}", method = RequestMethod.GET, produces = "text/html;charset=UTF-8") public String query(@PathVariable String keyword) { }

第二:tomcat server.xml 中
<Connector connectionTimeout="20000" port="8080" protocol="HTTP/1.1" redirectPort="8443" URIEncoding="UTF-8"/>

注意:如果使用eclipse启动tomcat时,需要将workspace下面 的server.xml 中的Connector也添加URIEncoding="UTF-8"

 

相关文章:

  • 2021-08-23
  • 2021-10-10
  • 2022-12-23
  • 2022-01-07
  • 2021-11-03
  • 2021-08-17
  • 2021-11-12
猜你喜欢
  • 2018-01-25
  • 2022-12-23
  • 2022-02-15
相关资源
相似解决方案