开发者

mvc:resources not picking up everything under resource folder

This thing works for 4 of the 5 folders under _res.

<mvc:resources mapping="/_res/**" location="/_res/"/>

It is not picking anything up under开发者_如何转开发 the fonts folder which is referenced from the style sheets like this

src:    url('../fonts/proximanova-bold-webfont.eot');

Everything under the _res folder is being reflected in the application.

_res
css
fonts
i
js
video 


I realise this answer is a few months late, but I've just had the same issue so thought I should add an answer for anyone else who comes across it.

The Spring Resources Servlet won't serve content it doesn't have a mime-type for, so in your case for .eot files you need to add

<mime-mapping>
    <extension>eot</extension>
    <mime-type>application/vnd.ms-fontobject</mime-type>
</mime-mapping>

to your web.xml file.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜