开发者

How handle resources likes images, *.css with Spring Mvc

I've a problem with handle static resources. It's my web-app WebAppRoot -resources -css -style.css -imahes -jsp -template.jsp -secure -tem开发者_Python百科plate_secure.jsp so myLocation=resources

How can I handle resource in a central way, for example I put location in a variable and use this in tag

I tried with but I don't understand how have to use.


If you are using Spring 3.0.4 or later, you can use the < mvc:resources ...> element in your application configuration, and you will not need to create a Controller to handle static content for you.

It is as simple as specifying the location of your static content, and the path from which to access them:

<mvc:resources mapping="/resources/**" location="/public-resources/"/>

This uses the mvc namespace found http://static.springsource.org/schema/mvc/spring-mvc.xsd.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜