Package io.undertow.server.handlers
Class ResponseCodeHandler
- java.lang.Object
-
- io.undertow.server.handlers.ResponseCodeHandler
-
- All Implemented Interfaces:
HttpHandler
public final class ResponseCodeHandler extends Object implements HttpHandler
A handler which simply sets a response code.- Author:
- David M. Lloyd
-
-
Field Summary
Fields Modifier and Type Field Description static ResponseCodeHandler
HANDLE_200
A handler which sets a 200 code.static ResponseCodeHandler
HANDLE_403
A handler which sets a 403 code.static ResponseCodeHandler
HANDLE_404
A handler which sets a 404 code.static ResponseCodeHandler
HANDLE_405
A handler which sets a 405 code.static ResponseCodeHandler
HANDLE_406
A handler which sets a 406 code.static ResponseCodeHandler
HANDLE_500
A handler which sets a 500 code.
-
Constructor Summary
Constructors Constructor Description ResponseCodeHandler(int responseCode)
Construct a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
handleRequest(HttpServerExchange exchange)
Handle the request.String
toString()
-
-
-
Field Detail
-
HANDLE_200
public static final ResponseCodeHandler HANDLE_200
A handler which sets a 200 code. This is the default response code, so in most cases this simply has the result of finishing the request
-
HANDLE_403
public static final ResponseCodeHandler HANDLE_403
A handler which sets a 403 code.
-
HANDLE_404
public static final ResponseCodeHandler HANDLE_404
A handler which sets a 404 code.
-
HANDLE_405
public static final ResponseCodeHandler HANDLE_405
A handler which sets a 405 code.
-
HANDLE_406
public static final ResponseCodeHandler HANDLE_406
A handler which sets a 406 code.
-
HANDLE_500
public static final ResponseCodeHandler HANDLE_500
A handler which sets a 500 code.
-
-
Method Detail
-
handleRequest
public void handleRequest(HttpServerExchange exchange) throws Exception
Description copied from interface:HttpHandler
Handle the request.- Specified by:
handleRequest
in interfaceHttpHandler
- Parameters:
exchange
- the HTTP request/response exchange- Throws:
Exception
-
-