title: Spring MVC CSS and JS not loading
body: <p>Including floder structure</p>
  
  <p><a href="https://i.stack.imgur.com/Me4bL.png" rel="nofollow"><img src="https://i.stack.imgur.com/Me4bL.png" alt="enter image description here"></a>I am developing a web application in Spring MVC. I have issues loading CSS and JS files in JSP.</p>
  
  <p>I googled for hours and tried all options, but not succeeded.
  Here is what i did</p>
  
  <ol>
  <li>tried to load as normal web app giving relative path </li>
  <li>tried including mvc:resources</li>
  <li>tried loading through Resource Servlet even then nothing worked.</li>
  </ol>
  
  <p>All three were tried separately
  I am wondering what had i missed.</p>
  
  <p>traditional link for #1</p>
  
  <pre><code>&lt;link rel="stylesheet" type="text/css" href="css/bootstrap.min.css"&gt;
  </code></pre>
  
  <p>No changes done in mvc-config or web.xml</p>
  
  <p>App Config for #2</p>
  
  <pre><code>&lt;mvc:resources mapping="/resources/**" location="/resources/"/&gt;
  </code></pre>
  
  <p>Web XML for #3</p>
  
  <pre><code>&lt;servlet&gt;
      &lt;servlet-name&gt;Resource Servlet&lt;/servlet-name&gt;
      &lt;servlet-class&gt;org.springframework.js.resource.ResouceServlet&lt;/servlet-class&gt;
      &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
  &lt;/servlet&gt;
  &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;Resource Servlet&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/resources/*&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;
  </code></pre>
  
  
  
  <p><a href="https://i.stack.imgur.com/9Ta0p.png" rel="nofollow"><img src="https://i.stack.imgur.com/9Ta0p.png" alt="enter image description here"></a></p>