首页 > 代码库 > 【常见问题】使用Tomcat发布html页面乱码

【常见问题】使用Tomcat发布html页面乱码

1 <mime-mapping> 
2     <extension> htm < /extension> 
3     <mime-type>text/html</mime-type>
4 </mime-mapping>
5 <mime-mapping>
6     <extension>html</extension>
7     <mime-type>text/html</mime-type>
8 </mime-mapping>

找到这个东东,改成下面这样的就行啦

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>

这就是服务器的解析方法喽 ^_^