A default servlet mapping has a mapping of only the / character. In previous versions of WebSphere,
a call to the javax.servlet.http.HttpServletRequest.getServletPath method for a default servlet mapping
returns an empty string, and a call to the javax.servlet.http.HttpServletRequest.getPathInfo method
returns the / character.
However, in Liberty with the Servlet 4.0 feature, a call to getServletPath for a default servlet mapping
will return the / character and a call to getPathInfo will return null.
For example, consider the following code:
In WebSphere traditional and Liberty with Servlet 3.0 or 3.1, the code will have the following output:
In Liberty with Servlet 4.0, the code will have the following output:
To return to the previous behavior when using the Servlet 4.0 feature, add the following configuration to the
server.xml file: <webContainer servletPathForDefaultMapping="false"/>
For additional information, see: