Problem serving JS resources
Hello everyone,
I'm trying to use Spring JS and Spring Faces in my project, but the resources never get loaded, I get a 404 error when looking up the .js and .css files.
My dispatcher servlet is mapped to /spring/* like the following in my web.xml:
Code:
<servlet>
<servlet-name>dispatcher</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/config/dispatcher-servlet.xml</param-value>
</init-param>
<load-on-startup>2</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>dispatcher</servlet-name>
<url-pattern>/spring/*</url-pattern>
</servlet-mapping>
And, since I'm using Spring 3.1, I'm configuring the resources to be loaded like the documentation suggests:
Code:
<mvc:resources mapping="/resources/**" location="/, classpath:/META-INF/web-resources/" />
According to the docs, the full URL for the resources in my app should be along the lines of: /myapp/spring/resources/spring/Spring.js since my dispatcher servlet is mapped to /spring/*. However, I have not been able to configure the resources to point to that URL, no matter what I change in the mvc:resources location attribute, I always get a URL like: /myapp/resources/spring/Spring.js and the resources are not found (404 error).
Is there something I am missing? Thank you in advance...