tomcat cannot send font files correctly, resulting in browsers not able to parse fonts correctly

Generally, the font file is placed under /resouce, the browser warns that the parsing fails, and it is observed that "response context type is text/plaintext".

solve:

 

 In tomcat or web.xml in your mind, add 
<mime-mapping>
    <extension>woff2</extension>
    <mime-type>application/x-font-woff</mime-type>
</mime-mapping> 

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326334985&siteId=291194637