We have a bunch of .js files in a web application that are not located under the same directory. The user interface was developed separately, and it took quite a while to reorganize it to have all * .js files in one place.
The problem is that these files are very heavily cached by browsers, and this creates a lot of problems with every update of the application. And we decided to disable caching for these files.
So, the * .js files were included in the servlet mapping:
<servlet-mapping>
<servlet-name>app</servlet-name>
<url-pattern>*.js</url-pattern>
</servlet-mapping>
I tried using mvc: resources, but it does not handle url masks as follows:
<mvc:resources mapping="*.js" location="*.js" cache-period="0"/>
This does not work, and I have a 404 answer when I try to access the js file.
I also tried mvc: interceptor:
<mvc:interceptor>
<mvc:mapping path="*.js"/>
<bean id="webJSContentInterceptor"
class="org.springframework.web.servlet.mvc.WebContentInterceptor">
<property name="cacheSeconds" value="0"/>
<property name="useExpiresHeader" value="true"/>
<property name="useCacheControlHeader" value="true"/>
<property name="useCacheControlNoStore" value="true"/>
</bean>
</mvc:interceptor>
This also results in a 404 error.
Is it possible?