com.sun.jersey.config.property.WebPageContentRegex parameter fails on a Websphere Application Server.
WebPageContentRegex is a Filter parameter that takes regex expressions that are used to allow requests to be passed to the underlying servlet to process.
This feature works fine in Weblogic Application Servers.
This feature becomes disabled in a Websphere Applications Servers.
The details of the configuration are as follows.
MyServletContainer which extends com.sun.jersey.spi.container.servlet.ContainerServlet is declared as a filter. The filter is mapped to "/*" url path.
A filter parameter value for com.sun.jersey.config.property.WebPageContentRegex is provided as "/(css|schema|images)"
A request for /warrootcontext/schema/css/test.xsl fails with a 404 not found message.
A similar request for the same configuration succeeds on weblogic.
On going through the source code of com.sun.jersey.spi.container.servlet.ContainerServlet, the following issue is seen.
In the method public void doFilter(HttpServletRequest,HttpServletResponse, FilterChain), static content processing is done on the basis of request.getServletPath().
Javadocs for HttpServletRequest method states that "Returns the part of this request's URL that calls the servlet." More explicitly, "This method will return an empty string ("") if the servlet used to process this request was matched using the "/*" pattern".
The reported issue is resolved if the code is modified to to do the static content processing based on the return value of request.getPathInfo().