Tomcat下页面传值乱码问题

Tomcat下无论post还是get,页面设置好charset=utf-8依旧乱码。
当然首先还是tomcat的webapps下设置过滤器。
<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>

<url-pattern>/*</url-pattern>注/*勿写成.*
/conf/server.xml下设置
<Connector port="7070" protocol="HTTP/1.1" 
               connectionTimeout="20000" 
               redirectPort="7443" useBodyEncodingForURI="true" URIEncoding="utf-8"/>
<Connector port="7009" protocol="AJP/1.3" redirectPort="7443"  URIEncoding="utf-8"/>
第二个为apache设置

你可能感兴趣的:(xml)