I had a servlet filter that had to bypass the normal authorisation flow when a special URL parameter was given. Instead of hard-coding that parameter in java, declaring it in web.xml has the advantage of being able to change it from time to time.
In general the same holds for all settings, that are best suited being declarative: timeouts, max accepted image size, buffer size. The "almost eternal" constants.
In one case a servlet could be kept entirely generic, but the key name was business application (=human client) specific:
x.y.general.servlets.MyGenericServlet -> neutral library code
x.y.clients.abc -> ABC specific code
web.xml:
<servlet>
<servlet-name>My Servlet</servlet-name>
<servlet-class>x.y.general.servlets.MyGenericServlet</servlet-class>
<init-param>
<description>For ABC</description>
<param-name>keyName</param-name>
<param-value>ABC_ID</param-value>
</init-param>
</servlet>