2

I've a problem with handle static resources. It's my web-app WebAppRoot -resources -css -style.css -imahes -jsp -template.jsp -secure -template_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.

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.