Package io.muserver
Interface RouteHandler
-
public interface RouteHandler
A handler for a Route created withMuServerBuilder.addHandler(Method, String, RouteHandler)
orRoutes.route(Method, String, RouteHandler)
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
handle(MuRequest request, MuResponse response, java.util.Map<java.lang.String,java.lang.String> pathParams)
Called when a request matches the given route
-
-
-
Method Detail
-
handle
void handle(MuRequest request, MuResponse response, java.util.Map<java.lang.String,java.lang.String> pathParams) throws java.lang.Exception
Called when a request matches the given route- Parameters:
request
- The requestresponse
- The responsepathParams
- A map of path parameters, for exampleid
would equal"123"
if the route URI template was/things/{id : [0-9]+}
and the requested URI was/things/123
- Throws:
java.lang.Exception
- Throwing an exception will result in a500
error code being returned.
-
-