update to latest servlet API behaviour

This commit is contained in:
Greg Wilkins 2017-07-18 13:11:53 +02:00
parent f4f6d834e7
commit 1956087277
2 changed files with 5 additions and 7 deletions

View File

@ -2447,7 +2447,6 @@ public class Request implements HttpServletRequest
throw new ServletException("HttpServletRequest.upgrade() not supported in Jetty"); throw new ServletException("HttpServletRequest.upgrade() not supported in Jetty");
} }
public void setPathSpec(PathSpec pathSpec) public void setPathSpec(PathSpec pathSpec)
{ {
_pathSpec = pathSpec; _pathSpec = pathSpec;
@ -2458,9 +2457,8 @@ public class Request implements HttpServletRequest
return _pathSpec; return _pathSpec;
} }
@Override
// TODO replace with overriden version from API public HttpServletMapping getHttpServletMapping()
public HttpServletMapping getMapping()
{ {
final PathSpec pathSpec = _pathSpec; final PathSpec pathSpec = _pathSpec;
final MappingMatch match; final MappingMatch match;
@ -2479,7 +2477,7 @@ public class Request implements HttpServletRequest
break; break;
case EXACT: case EXACT:
match = MappingMatch.EXACT; match = MappingMatch.EXACT;
mapping = _servletPath; mapping = _servletPath.startsWith("/")?_servletPath.substring(1):_servletPath;
break; break;
case SUFFIX_GLOB: case SUFFIX_GLOB:
match = MappingMatch.EXTENSION; match = MappingMatch.EXTENSION;

View File

@ -24,7 +24,7 @@ import static org.junit.Assert.assertNull;
import org.junit.Test; import org.junit.Test;
@Deprecated
public class IPAddressMapTest public class IPAddressMapTest
{ {
@Test @Test