mvc:resources Spring mapping not working
<p>I am trying to map any requests that come to <code>/views/node_modules/*</code> to <code>/resources/angular_resources/*</code> folder in my Spring project. How could I achieve this?</p>

<p>Currently I have <code>applicationContext.xml</code> file that looks the following way:</p>

<pre><code>&lt;context:component-scan
    base-package="fomoapp.domain, fomoapp.dao, fomoapp.service" /&gt;

&lt;!-- Root Context: defines shared resources visible to all other web components --&gt;
&lt;mvc:resources mapping="/resources/**" location="/resources/" /&gt;
&lt;mvc:resources mapping="/views/node_modules/**" location="/resources/angular_resources/" /&gt;
&lt;mvc:default-servlet-handler/&gt;
</code></pre>

<p>Full <code>web.xml</code>:</p>



<p></p>

<pre><code>&lt;context-param&gt;
    &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
    &lt;param-value&gt;classpath*:/META-INF/spring/applicationContext.xml
    classpath*:/META-INF/spring/applicationContext-security.xml
    &lt;/param-value&gt;
&lt;/context-param&gt;

&lt;listener&gt;
    &lt;listener-class&gt;org.springframework.web.context.ContextLoaderListener
    &lt;/listener-class&gt;
&lt;/listener&gt;

&lt;filter&gt;
    &lt;filter-name&gt;springSecurityFilterChain&lt;/filter-name&gt;
    &lt;filter-class&gt;org.springframework.web.filter.DelegatingFilterProxy
    &lt;/filter-class&gt;
&lt;/filter&gt;

&lt;filter-mapping&gt;
    &lt;filter-name&gt;springSecurityFilterChain&lt;/filter-name&gt;
    &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
&lt;/filter-mapping&gt;

&lt;servlet&gt;
  &lt;servlet-name&gt;fomoapp&lt;/servlet-name&gt;
  &lt;servlet-class&gt;org.springframework.web.servlet.DispatcherServlet&lt;/servlet-class&gt;
  &lt;init-param&gt;
    &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
    &lt;param-value&gt;/WEB-INF/spring/fomoapp-config.xml&lt;/param-value&gt;
  &lt;/init-param&gt;
  &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
&lt;/servlet&gt;

&lt;servlet-mapping&gt;
  &lt;servlet-name&gt;fomoapp&lt;/servlet-name&gt;
  &lt;url-pattern&gt;/&lt;/url-pattern&gt;
&lt;/servlet-mapping&gt;

&lt;servlet-mapping&gt;
    &lt;servlet-name&gt;default&lt;/servlet-name&gt;
    &lt;url-pattern&gt;*.css&lt;/url-pattern&gt;
&lt;/servlet-mapping&gt;

&lt;servlet-mapping&gt;
    &lt;servlet-name&gt;default&lt;/servlet-name&gt;
    &lt;url-pattern&gt;*.js&lt;/url-pattern&gt;
&lt;/servlet-mapping&gt;

&lt;servlet-mapping&gt;
    &lt;servlet-name&gt;default&lt;/servlet-name&gt;
    &lt;url-pattern&gt;/views/node_modules/&lt;/url-pattern&gt;
&lt;/servlet-mapping&gt;
</code></pre>

<p></p>

<p>I tried the solution here: <a href="https://stackoverflow.com/questions/8184066/absolute-path-in-mvcresources-instead-of-path-relative-to-mapping-of-spring?rq=1">Absolute path in &lt;mvc:resources/&gt; instead of path relative to mapping of spring servlet</a></p>

<p>But it does not work somehow.</p>