浏览器处理方式mime-mapping

mime-mapping是web.xml中的一个节点,用来指定对应的格式的浏览器处理方式,常用的集中配置如下:

    <mime-mapping>
        <extension>mhtextension>
        <mime-type>text/x-mhtmime-type>
    mime-mapping>
    <mime-mapping>
        <extension>rarextension>
        <mime-type>application/octet-streammime-type>
    mime-mapping>
    <mime-mapping>
        <extension>isoextension>
        <mime-type>application/octet-streammime-type>
    mime-mapping>
    <mime-mapping>
        <extension>apeextension>
        <mime-type>application/octet-streammime-type>
    mime-mapping>
    <mime-mapping>
        <extension>rmvbextension>
        <mime-type>application/octet-streammime-type>
    mime-mapping>
    <mime-mapping>
        <extension>icoextension>
        <mime-type>image/x-iconmime-type>
    mime-mapping>

    <mime-mapping>
        <extension>docextension>
        <mime-type>application/mswordmime-type>
    mime-mapping>
    <mime-mapping>
        <extension>xlsextension>
        <mime-type>application/vnd.ms-excelmime-type>
    mime-mapping>
    <mime-mapping>
        <extension>pptextension>
        <mime-type>application/vnd.ms-powerpointmime-type>
    mime-mapping>

另外也可以用来配置静态页面的打开编码:

 
 <mime-mapping>
  <extension>htmextension> 
  <mime-type>text/html;charset=gb2312mime-type> 
  mime-mapping>
 <mime-mapping>
  <extension>htmlextension> 
  <mime-type>text/html;charset=gb2312mime-type> 
  mime-mapping>

你可能感兴趣的:(web.xml)