问题在于pom.xml中Tomcat8的配置
<!--tomcat插件-->
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<!-- tomcat7的插件, 不同tomcat版本这个也不一样 -->
<artifactId>tomcat8-maven-plugin</artifactId>
<version>3.0-r1655215</version>
<configuration>
<!-- 通过maven tomcat8:run运行项目时,访问项目的端口号 -->
<port>80</port>
<uriEncoding>UTF-8</uriEncoding>
<!-- 项目访问路径 本例:localhost:9090, 如果配置的aa, 则访问路径为localhost:9090/aa-->
<path>/travel</path>
</configuration>
</plugin>
要在中间插入<uriEncoding>UTF-8</uriEncoding>
来为网页定义编码,仅在html文件开头定义是不行的,使用get方式提交表单信息时会通过tomcat默认的url编码格式对中文编码,而不是html中定义的编码方式