springmvc接收get请求的参数不一定会乱码
tomcat 8.xx 之前 编码默认是iso 之后 编码默认是utf-8
springmvc接收post请求没有编码规定所以会乱码
编写web.xml 添加CharacterEncodingFilter
<filter>
<filter-name>charset</filter-name>
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>charset</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>