我最近开始使用font-awesome v4.5.0。直到我从java 7升级到java 8并将spring框架从v3.2升级到v4.0之前它才像魅力一样工作
现在,font-awesome图标显示为正方形。浏览器控制台(firebug)显示 -
NetworkError:404 Not Found - http://localhost/myapp/fonts/fontawesome-webfont.woff2?v=4.5.0
和tomcat的catalina.out日志显示以下警告 -
No mapping found for HTTP request with URI [/myapp/fonts/fontawesome-webfont.woff2 in DispatcherServlet with name 'myappservlet'
No mapping found for HTTP request with URI [/myapp/fonts/fontawesome-webfont.woff] in DispatcherServlet with name 'myappservlet'
No mapping found for HTTP request with URI [/myapp/fonts/fontawesome-webfont.ttf] in DispatcherServlet with name 'myappservlet'
'字体的位置'在font-awesome.min.css' s-font-face src中正确指定了文件夹。 (除了java版本和spring框架版本之外没有任何变化。它突然停止工作)
答案 0 :(得分:0)
我有同样的问题。 你在web.xml中有这样的东西吗?
<servlet>
<servlet-name>dispatcher</servlet-name>
<servlet-class>
org.springframework.web.servlet.DispatcherServlet
</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/applicationContext.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>dispatcher</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
评论这些线条为我解决了问题。