Multiple servlet mappings for the same URL pattern exist. Duplicate servlet mappings often indicate left over debug code or a typographical error.
Duplicate servlet mappings serve no purpose since only the last entry will be applied when the same URL pattern is used in multiple servlet mappings.
Example 1: In the following example, the URL pattern /servletA/*
is used in two different servlet mappings.
<servlet-mapping>
<servlet-name>ServletA</servlet-name>
<url-pattern>/servletA/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>ServletB</servlet-name>
<url-pattern>/servletA/*</url-pattern>
</servlet-mapping>
[1] Standards Mapping - Common Weakness Enumeration - (CWE) CWE ID 398