title: Having two different servlets mapped on the same URL pattern
body: <p>I encountered a J2EE project written by others. When I come to the <code>web.xml</code>, there are two different servlets mapped on the same URL pattern. I wonder the purpose of this approach. How exactly does that work and what's the puspose?</p>
  
  <p>Here is the relevant part of the <code>web.xml</code>:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;servlet&gt;
      &lt;servlet-name&gt;fileDownload&lt;/servlet-name&gt;
      &lt;servlet-class&gt;com.htsoft.core.web.servlet.FileDownloadServlet&lt;/servlet-class&gt;
  &lt;/servlet&gt;
  &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;fileDownload&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/file-download&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  
  &lt;servlet&gt;
      &lt;servlet-name&gt;fileDownLoad&lt;/servlet-name&gt;
      &lt;servlet-class&gt;com.kaiwii.oa.action.system.FileDownloadServlet&lt;/servlet-class&gt;
  &lt;/servlet&gt;
  &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;fileDownLoad&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/file-downLoad&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;  
  </code></pre>