title: Mapping resource to jsp in Spring MVC 3.2.4
body: <p>I have a problem about mapping css, js, images to my jsp:
  My project like this:</p>
  
  <p>src/main/webapp/WEB-INF/web.xml</p>
  
  <pre><code>    &lt;servlet&gt;
      &lt;servlet-name&gt;appServlet&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/servlet-context.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;appServlet&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;*.gif&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;*.jpg&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;*.png&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  </code></pre>
  
  <p>src/main/webapp/WEB-INF/servlet-context.xml</p>
  
  <pre><code>  &lt;mvc:annotation-driven /&gt;
   &lt;mvc:resources mapping="/jsp/**" location="/jsp/" /&gt;
  </code></pre>
  
  <p>src/main/webapp/WEB-INF/jsp/css/style.css</p>
  
  <p>src/main/webapp/WEB-INF/jsp/js/jquery-func.js</p>
  
  <p>src/main/webapp/WEB-INF/jsp/images/sample.jpg</p>
  
  <p>src/main/webapp/WEB-INF/jsp/index.jsp</p>
  
  <pre><code>&lt;head&gt;
      &lt;title&gt;Shop Around&lt;/title&gt;
      &lt;meta http-equiv='Content-type' content='text/html; charset=utf-8'/&gt;
      &lt;link rel='stylesheet' href='jsp/css/style.css' type='text/css' media='all'/&gt;
      &lt;script src='jsp/js/jquery-1.4.1.min.js' type='text/javascript'&gt;&lt;/script&gt;
      &lt;script src='jsp/js/jquery.jcarousel.pack.js' type='text/javascript'&gt;&lt;/script&gt;
      &lt;script src='jsp/js/jquery-func.js' type='text/javascript'&gt;&lt;/script&gt;
  &lt;/head&gt;
  </code></pre>