I encountered a J2EE project written by others. When I come to the web.xml
, 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?
Here is the relevant part of the web.xml
:
<servlet>
<servlet-name>fileDownload</servlet-name>
<servlet-class>com.htsoft.core.web.servlet.FileDownloadServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>fileDownload</servlet-name>
<url-pattern>/file-download</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>fileDownLoad</servlet-name>
<servlet-class>com.kaiwii.oa.action.system.FileDownloadServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>fileDownLoad</servlet-name>
<url-pattern>/file-downLoad</url-pattern>
</servlet-mapping>