SpringMvc的post方式中文乱码解决方案

在web.xml中的<web-app>中加入

	<!-- 配置Post请求乱码 -->
	<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>

乱码问题解决!

猜你喜欢

转载自blog.csdn.net/coffee_fighter/article/details/81516031