title: How can I configure web.xml url-pattern to get specified location?
body: <p>I want to handle requests to <code>/Projects</code> and <code>/Projects/SomeProject/</code> with 'ProjectsServlet' but return <code>404</code> error code while accessing <code>/Projects/SomePath/SomeOtherSubPath</code>.</p>
  
  <p>Project names are updated frequently, so I don't want to rewrite my Servlet code every time it happens and I've written simple parser of project name and servlet loads specified page if it exists.</p>
  
  <p>So how can I write config in web.xml? Now it looks like:</p>
  
  <pre><code>&lt;servlet&gt;
    &lt;servlet-name&gt;ProjectsServlet&lt;/servlet-name&gt;
    &lt;servlet-class&gt;com.example.ProjectsServlet&lt;/servlet-class&gt;
  &lt;/servlet&gt;
  
  &lt;servlet-mapping&gt;
    &lt;servlet-name&gt;ProjectsServlet&lt;/servlet-name&gt;
    &lt;url-pattern&gt;/Projects/*&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  </code></pre>
  
  <p>But it also trying to handle all requests after 'Projects' root directory <code>/Projects/.../...</code></p>
  
  <p>In the best case I want to write mapping like this:</p>
  
  <pre><code>&lt;servlet-mapping&gt;
    &lt;servlet-name&gt;ProjectsServlet&lt;/servlet-name&gt;
    &lt;url-pattern&gt;/Projects&lt;/url-pattern&gt;
    &lt;url-pattern&gt;/Projects/*/&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  </code></pre>
  
  <p>But it's not correct. How can I do the same?</p>