这个东西适用于 _res 下 5 个文件夹中的 4 个。
<mvc:resources mapping="/_res/**" location="/_res/"/>
它没有在字体文件夹下拾取从样式表引用的任何内容,如下所示
src: url('../fonts/proximanova-bold-webfont.eot');
_res 文件夹下的所有内容都会反射(reflect)在应用程序中。
_res
css
fonts
i
js
video
最佳答案
我意识到这个答案晚了几个月,但我刚刚遇到了同样的问题,所以我认为我应该为遇到它的其他人添加一个答案。
Spring Resources Servlet 不会提供没有 mime 类型的内容,因此对于 .eot 文件,您需要添加
<mime-mapping>
<extension>eot</extension>
<mime-type>application/vnd.ms-fontobject</mime-type>
</mime-mapping>
到您的 web.xml 文件。
关于spring-mvc - mvc :resources not picking up everything under resource folder,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7422471/