Check for a behavior change on the sendRedirect method

This rule flags references to the javax.servlet.http.HttpServletResponse.sendRedirect(String) method because the default behavior for relative URLs is different in the Servlet 3.1 implementation than in the Servlet 3.0 implementation. The behavior for Servlet 3.1 matches the behavior of when the Servlet 3.0 com.ibm.ws.webcontainer.RedirectWithPathInfo property is set to true, and the property is ignored in the Servlet 3.1 implementation.

In Servlet 3.1, if the relative location does not have a leading '/', the container interprets the location as being relative to the current request URI. If the relative location has a leading '/', the container interprets the location as being relative to the servlet container root.

For example, if the redirection location that is provided by the application is folder/default.jsp, with no leading '/', and the inbound request URL is http://host:port/context_root/extraFolder or http://host:port/context_root/extraFolder/, in Servlet 3.1 the request is redirected to http://host:port/context_root/extraFolder/folder/default.jsp, which is relative to the current request URI. In Servlet 3.0, the request is redirected to http://host:port/context_root/folder/default.jsp, unless the com.ibm.ws.webcontainer.RedirectWithPathInfo property is set to true.

For more information about this method, see Interface HttpServletResponse.

For more information on Servlet 3.1 behavior changes, see the following resource: Servlet 3.1 behavior changes.