jsp乱码问题
有的时候我们在页头加上chaset pageEncoding 都没用,得在web.xml中配置
照抄一下别人的,自己好找一些~
1 <mime-mapping> 2 <extension>htm</extension> 3 <mime-type>text/html;charset=utf-8</mime-type> 4 </mime-mapping> 5 <mime-mapping> 6 <extension>html</extension> 7 <mime-type>text/html;charset=utf-8</mime-type> 8 </mime-mapping> 9 <mime-mapping> 10 <extension>jsp</extension> 11 <mime-type>text/html;charset=utf-8</mime-type> 12 </mime-mapping> 13 <mime-mapping> 14 <extension>action</extension> 15 <mime-type>text/html;charset=utf-8</mime-type> 16 </mime-mapping>
或者
1 <jsp-config> 2 <jsp-property-group> 3 <description>test encode</description> 4 <display-name>test encode</display-name> 5 <url-pattern>/*</url-pattern> 6 <page-encoding>utf-8</page-encoding> 7 </jsp-property-group> 8 </jsp-config>