首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > CSS >

eclipse停访问html文件中文乱码

2012-07-22 
eclipse下访问html文件中文乱码换成win7系统新装了eclipse发现html文件本身不乱码,到部署项目后访问就偏偏

eclipse下访问html文件中文乱码

换成win7系统新装了eclipse

发现html文件本身不乱码,到部署项目后访问就偏偏乱码

eclipse的window-》Preferences下该设置成utf-8的都设置,还是乱码,心里骂了eclipse千万遍

没办法只能从tomcat找问题了

原来是tomcat的web.xml文件里的问题

原来代码如下

?

<mime-mapping> <extension> htm < /extension> <mime-type>text/html </mime-type></mime-mapping><mime-mapping><extension>html</extension><mime-type>text/html</mime-type></mime-mapping>
?

?

把上面代码修改为

?

?

<mime-mapping> <extension> htm < /extension> <mime-type>text/html;charset=utf-8</mime-type></mime-mapping><mime-mapping><extension>html</extension><mime-type>text/html;charset=utf-8</mime-type></mime-mapping>
?

重启项目运行,终于可以了。。。。

热点排行