title: Spring MVC with Thymeleaf + Bootstrap using webjars
body: <p>I have a Spring project where I included the following webjars into <code>pom.xml</code>:</p>
  
  <pre><code>&lt;dependency&gt;
      &lt;groupId&gt;org.webjars&lt;/groupId&gt;
      &lt;artifactId&gt;bootstrap&lt;/artifactId&gt;
      &lt;version&gt;3.3.7-1&lt;/version&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
      &lt;groupId&gt;org.webjars&lt;/groupId&gt;
      &lt;artifactId&gt;jquery&lt;/artifactId&gt;
      &lt;version&gt;3.1.1&lt;/version&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p>Then I included in my HTML view the following link and scripts:</p>
  
  <pre><code>&lt;link rel="stylesheet" href="@{/webjars/bootstrap/3.3.7-1/css/bootstrap.min.css}" /&gt;
  
  &lt;script src="@{/webjars/jquery/3.1.1/jquery.min.js}"&gt;&lt;/script&gt;
  &lt;script src="@{/webjars/bootstrap/3.3.7-1/js/bootstrap.min.js}"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>But it didn't work, no mapping found:</p>
  
  <pre><code>[org.springframework.web.servlet.PageNotFound] (default task-15) No mapping found for HTTP request with URI [/TestPublicWeb-0.0.1-SNAPSHOT/webjars/bootstrap/3.3.7-1/css/bootstrap.min.css] in DispatcherServlet with name 'testapp'
  </code></pre>
  
  <p>...so I tried to include the following mapping into <code>servlet.xml</code>:</p>
  
  <pre><code>&lt;mvc:resources mapping="/webjars/**" location="classpath:/META-INF/resources/webjars/"/&gt;
  </code></pre>
  
  <p>But with this, mapping for my <code>/TestApplication</code> is not found:</p>
  
  <pre><code>[org.springframework.web.servlet.PageNotFound] (default task-13) No mapping found for HTTP request with URI [/TestApplication/] in DispatcherServlet with name 'testapp'
  </code></pre>
  
  <p>How should webjars be included in a Spring project in a correct way?</p>