jorgen
jorgen

Reputation: 1257

Auto refresh of static content in Spring 3

In my Spring 3 web app the users are able to upload images using Springs multipart resolver. The image is save to the folder defined in the apps servlet-context.xml:

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

The problem is that I need to refresh the resources folder on the server to make the newly images visible to the user.

How can I make Spring/Tomcat auto-refresh the images after each upload?

Upvotes: 1

Views: 1556

Answers (1)

Anantha Sharma
Anantha Sharma

Reputation: 10098

is this "resources" folder a watched folder in tomcat.. you can make a folder as watched by adding a configuration in server.xml.

also, when dealing with images & other static contents, the server would lookup the file when required & the content is delivered, please check if the browser is caching the result before making any changes in the server.

Upvotes: 2

Related Questions