中文乱码处理
有好几个地方:
1.JSP设置 contentType
2.Filter:utf8 <Connector useBodyEncodingForURI="true" />?
?也可URIEncoding="UTF-8"
http://tomcat.apache.org/tomcat-7.0-doc/config/http.html
URIEncodingThis specifies the character encoding used to decode the URI bytes, after %xx decoding the URL. If not specified, ISO-8859-1 will be used.
?
可以用此参数,指定在使用%XX解码URL之后,用来解码URI的字符集。如果未指定,ISO-8859-1被使用。
useBodyEncodingForURIThis specifies if the encoding specified in contentType should be used for URI query parameters, instead of using the URIEncoding.This setting is present for compatibility with Tomcat 4.1.x, where the encoding specified in the contentType, or explicitly set using Request.setCharacterEncoding method was also used for the parameters from the URL. The default value is false.
?
此参数指定: 是否在URI查询参数(相当于GET请求参数吧) 中使用JSP页面的contentType编码,而不是使用上面URIEncoding定死的那个编码。这个设置兼容Tomcat4.1.x,就是说,在contentType中指定的编码字符集,或用request.setCharacterEncoding方法指定的编码字符集,同样也用于URL传来的参数。默认是=false的。
暂时先就这么标注下,下班了,有时间好好整理下