I have a question according the mapping behaviour.
If there are these mappings given:
<servlet-mapping>
<servlet-name> ServletA </servlet-name>
<url-pattern> *.xml </url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name> ServletB </servlet-name>
<url-pattern> /result/* </url-pattern>
</servlet-mapping>
And there is this HTTP-Request:
/result/example.xml
Which servlet would be mapped and why?
Given your <servlet-mapping>
configuration, the request for /result/example.xml
would be handled by ServletB
because a path match always trumps an extension match.
This is so because an extension match is considered to be a looser (not loser, though that works too :) constraint as it works site-wide when compared to a path match which targets a specific directory and its descendents and is hence more specific in nature.
The matching priority goes like this:
/
to handle all 404s)