I am using Spring MVC, and in the configuration I am using the following line to make some Javascript files available to my application:
<mvc:resources mapping="/resources/**" location="/,classpath:/META-INF/" />
However, I am concerned that this may lead to security issues, unforeseen circumstances, etc. because every single jar on my classpath (and there are many!) that have a META-INF folder will be accessible from /resources/ to a user who is poking around.
Is there a way to only map the location to a specific jar file. In my case, it would be Spring-JS jar located at the following location (relative to the root of my Eclipse workspace):
/Jars/spring 3.0.5/spring-js-2.0.7.RELEASE.jar
Any help would be appreciated. Thanks in advance.
You should instead restrict the specific locations exposed. For eg, for spring-js jar you can do this:
<mvc:resources mapping="/resources/**" location="classpath:/META-INF/web-resources" />I doubt if you can specify the exact jar though.