- 如果是post,在web.xml中加上
- < filter>
- < filter-name>CharacterEncodingFilter</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>CharacterEncodingFilter</filter-name>
- < url-pattern>/*</url-pattern>
- < /filter-mapping>
- 如果是get,需要修改Tomcat根式目录的 conf/server.xml文件中,在里面加uRIEncoding="utf-8"
时间: 2024-10-11 05:44:35