title: Spring: DispatcherServlet and static content
body: <p>In my Spring web-app i have mapped <code>/app/*</code> to dispatcher servlet. What is the <strong>best approach</strong> in that scenerio to separate a static content like <code>images</code>, <code>.js</code>, <code>.css</code> from dispatcher ? </p>
  
  <pre><code>&lt;servlet-mapping&gt;
      &lt;servlet-name&gt;dispatcher&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/app/*&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  </code></pre>
  
  <p>For example, when i open url: <code>http://server/context/app/users</code> and on users.jsp have <code>&lt;img src="images/test.png"/&gt;</code> i get no image because <code>http://server/conext/app/users/images/test.png</code> is not a right url.</p>
  
  <p>Now i use absolute path like: <code>&lt;img src="/context/images/test.png"/&gt;</code> but it complicates JSP code a little and searching something better.</p>