08-02
12
设置tomcat字符煸码为utf-8
作者:Java伴侣 日期:2008-02-12
设置tomcat的编码格式。把以下内容放到你的web.xml中。
还可以用以下方法
复制内容到剪贴板 程序代码
<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>
<mime-mapping>
<extension>jsp</extension>
<mime-type>text/html;charset=utf-8</mime-type>
</mime-mapping>
<mime-mapping>
<extension>action</extension>
<mime-type>text/html;charset=utf-8</mime-type>
</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>
<mime-mapping>
<extension>jsp</extension>
<mime-type>text/html;charset=utf-8</mime-type>
</mime-mapping>
<mime-mapping>
<extension>action</extension>
<mime-type>text/html;charset=utf-8</mime-type>
</mime-mapping>
复制内容到剪贴板 程序代码
<jsp-config>
<jsp-property-group>
<description>test encode</description>
<display-name>test encode</display-name>
<url-pattern>/*</url-pattern>
<page-encoding>utf-8</page-encoding>
</jsp-property-group>
</jsp-config>
<jsp-property-group>
<description>test encode</description>
<display-name>test encode</display-name>
<url-pattern>/*</url-pattern>
<page-encoding>utf-8</page-encoding>
</jsp-property-group>
</jsp-config>
评论: 0 | 引用: 0 | 查看次数: 843
发表评论