users@servlet-spec.java.net

[servlet-spec users] what is the behavior when getServletPath() and getPathInfo() are overridden?

From: Robert E Goff <goff1_at_us.ibm.com>
Date: Fri, 7 Sep 2012 16:45:31 -0400

What is the expected behavior when a request is wrapped within a filter by
a HttpServletRequestWrapper that overrides the getServletPath() method?
Does changing the returned value of this method affect the target resource?

For example, if you requested a url: "
http://server:port/contextRoot/servlet1" which had a filter associated it
which wrapped the request and overrode the getServletPath() method to
return "/servlet2" - should /servlet1's code be executed or /servlet2's?

Likewise, if the original url didn't map to a servlet, but was a static
resource and the wrapped request overrode the getPathInfo() method, does
that affect the resource that is served up?

Sincerely,
Robert Goff