@Contract(threading=SAFE) public class UriHttpRequestHandlerMapper extends Object implements HttpRequestHandlerMapper
*
*<uri>
<uri>*
HttpRequestHandler
matching a particular request URI. Usually the
mapped request handler will be used to process the request with the
specified request URI.Modifier | Constructor and Description |
---|---|
|
UriHttpRequestHandlerMapper() |
protected |
UriHttpRequestHandlerMapper(UriPatternMatcher<HttpRequestHandler> matcher) |
Modifier and Type | Method and Description |
---|---|
protected String |
getRequestPath(HttpRequest request)
Extracts request path from the given
HttpRequest |
HttpRequestHandler |
lookup(HttpRequest request)
Looks up a handler matching the given request URI.
|
void |
register(String pattern,
HttpRequestHandler handler)
Registers the given
HttpRequestHandler as a handler for URIs
matching the given pattern. |
void |
unregister(String pattern)
Removes registered handler, if exists, for the given pattern.
|
protected UriHttpRequestHandlerMapper(UriPatternMatcher<HttpRequestHandler> matcher)
public UriHttpRequestHandlerMapper()
public void register(String pattern, HttpRequestHandler handler)
HttpRequestHandler
as a handler for URIs
matching the given pattern.pattern
- the pattern to register the handler for.handler
- the handler.public void unregister(String pattern)
pattern
- the pattern to unregister the handler for.protected String getRequestPath(HttpRequest request)
HttpRequest
public HttpRequestHandler lookup(HttpRequest request)
lookup
in interface HttpRequestHandlerMapper
request
- the requestnull
if no match is found.Copyright © 2005–2022 The Apache Software Foundation. All rights reserved.