jetty切换tomcat中文乱码

项目中文在jetty下正常,换tomcat下出现乱码。
问题是web.xml中的encodingFilter不是第一个,要设置为第一个

	<filter>
		<filter-name>encodingFilter</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>
		<init-param>
			<param-name>forceEncoding</param-name>
			<param-value>true</param-value>
		</init-param>
	</filter>

	<filter-mapping>
		<filter-name>encodingFilter</filter-name>
		<url-pattern>/*</url-pattern>
	</filter-mapping>
posted @ 2019-04-29 15:55  离骚不骚  阅读(290)  评论(0编辑  收藏  举报