404 Error on Fonts in Tomcat/Java Web App

現象:在Java Web項目中使用fontawesome,在獲取字體文件時報404錯誤(路徑沒問題)。
解決:在web.xml中增長對該類特殊後綴名文件的支持
web

<mime-mapping>
    <extension>woff</extension>
    <mime-type>application/x-font-woff</mime-type>
</mime-mapping>

<mime-mapping>
    <extension>ttf</extension>
    <mime-type>application/octet-stream</mime-type>
</mime-mapping>

<mime-mapping>
    <extension>otf</extension>
    <mime-type>application/octet-stream</mime-type>
</mime-mapping>
相關文章
相關標籤/搜索