开发者

Mapping all css resources to a single folder using SpringMVC

开发者 https://www.devze.com 2023-03-03 03:47 出处:网络
Is there any way to map all css resources so that they are all served from /css folder from 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

精彩评论

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

关注公众号