public static class HTTPServer.MethodContextHandler extends Object implements HTTPServer.ContextHandler
MethodContextHandler services a context
by invoking a handler method on a specified object.
The method must have the same signature and contract as
HTTPServer.ContextHandler.serve(net.freeutils.httpserver.HTTPServer.Request, net.freeutils.httpserver.HTTPServer.Response), but can have an arbitrary name.
| Modifier and Type | Field and Description |
|---|---|
protected Method |
m |
protected Object |
obj |
| Constructor and Description |
|---|
MethodContextHandler(Method m,
Object obj) |
| Modifier and Type | Method and Description |
|---|---|
int |
serve(HTTPServer.Request req,
HTTPServer.Response resp)
Serves the given request using the given response.
|
public MethodContextHandler(Method m, Object obj) throws IllegalArgumentException
IllegalArgumentExceptionpublic int serve(HTTPServer.Request req, HTTPServer.Response resp) throws IOException
HTTPServer.ContextHandlerserve in interface HTTPServer.ContextHandlerreq - the request to be servedresp - the response to be filledIOException - if an IO error occursCopyright © 2021 freeutils.net. All rights reserved.