title: Can I combine these url-patterns in a servlet-mapping?
body: <p>I have a requirement to support /{servlet}/history, and have many servlets that need to support this.  I'm using Tomcat, FWIW.</p>
  
  <p>The following works, but I'm wondering if there's a way to combine all patterns into one line and avoid adding a url-pattern for every servlet that needs to support the history pattern.  I've tried several options and failed.</p>
  
  <pre><code>&lt;servlet&gt;
      &lt;servlet-name&gt;History&lt;/servlet-name&gt;
      &lt;servlet-class&gt;com.foo.HistoryServlet&lt;/servlet-class&gt;
  &lt;/servlet&gt;
  &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;History&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/aDifferentServlet/history/*&lt;/url-pattern&gt;
      &lt;url-pattern&gt;/someOtherOne/history/*&lt;/url-pattern&gt;
      &lt;url-pattern&gt;/anotherExample/history/*&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  ...
  &lt;servlet&gt;
      &lt;servlet-name&gt;aDifferentServlet&lt;/servlet-name&gt;
      &lt;servlet-class&gt;com.foo.aDifferentServlet&lt;/servlet-class&gt;
  &lt;/servlet&gt;
  &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;aDifferentServlet&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/aDifferentServlet/*&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  ...
  </code></pre>
  
  <p>Thanks.</p>