开发者

Mapping all css resources to a single folder using SpringMVC

Is there any way to map all css resources so that they are all served from /css folder from SpringMVC? Ex. /login/sampleUser/开发者_如何学Goie.css maps to /css/ie.css

I have been trying using <mvc:resources mapping="/css/**" location="/css/" >, but seems not to work.

Thanks


You can be use the Tuckey Url Rewrite Filter. There you can define complexer rewrite rules.

 <!-- I do not know if this fiter works (correctly), but it should
      demonstrate how it works-->
 <rule>
    <!-- redirect everything that ends with .css
         to resources, with same file name -->
    <from>/(.*)/$.css</from>
    <to type="redirect">/resouces/$1</to>
 </rule>
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜