Given a request to / and a welcome file set to /index
JBossWeb wil return "/" when HttpServletRequest#getRequestURI is called,
and "/index" when HttpServletRequest#getServletPath is called.
Undertow will return "/index" in both cases.
It's clear what happens by looking at ServletInitialHandler#handleRequest
which does a full rewrite for welcome files:
The Servlet spec (10.10) does seem to justify this somewhat by saying the
The container may send the request to the welcome resource with a forward, a redirect, or a container specific mechanism that is indistinguishable from a direct request.
However, the JavaDoc for HttpServletRequest#getRequestURI doesn't seem to allow this.
With a welcome file declaration in web.xml as follows:
and when requesting the context root of an application (e.g. http://localhost:8080 for a root deployment), the results are as follows: