public interface RouteHandler
MuServerBuilder.addHandler(Method, String, RouteHandler)
or Routes.route(Method, String, RouteHandler)
Modifier and Type | Method and Description |
---|---|
void |
handle(MuRequest request,
MuResponse response,
Map<String,String> pathParams)
Called when a request matches the given route
|
void handle(MuRequest request, MuResponse response, Map<String,String> pathParams) throws Exception
request
- The requestresponse
- The responsepathParams
- A map of path parameters, for example id
would equal "123"
if the route URI template was /things/{id : [0-9]+}
and the requested URI was
/things/123
Exception
- Throwing an exception will result in a 500
error code being returned.Copyright © 2017–2021. All rights reserved.