Package io.undertow.server.handlers
Class ResponseCodeHandler
java.lang.Object
io.undertow.server.handlers.ResponseCodeHandler
- All Implemented Interfaces:
HttpHandler
A handler which simply sets a response code.
- Author:
- David M. Lloyd
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ResponseCodeHandler
A handler which sets a 200 code.static final ResponseCodeHandler
A handler which sets a 403 code.static final ResponseCodeHandler
A handler which sets a 404 code.static final ResponseCodeHandler
A handler which sets a 405 code.static final ResponseCodeHandler
A handler which sets a 406 code.static final ResponseCodeHandler
A handler which sets a 500 code. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
handleRequest
(HttpServerExchange exchange) Handle the request.toString()
-
Field Details
-
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
A handler which sets a 403 code. -
HANDLE_404
A handler which sets a 404 code. -
HANDLE_405
A handler which sets a 405 code. -
HANDLE_406
A handler which sets a 406 code. -
HANDLE_500
A handler which sets a 500 code.
-
-
Constructor Details
-
ResponseCodeHandler
public ResponseCodeHandler(int responseCode) Construct a new instance.- Parameters:
responseCode
- the response code to set
-
-
Method Details
-
handleRequest
Description copied from interface:HttpHandler
Handle the request.- Specified by:
handleRequest
in interfaceHttpHandler
- Parameters:
exchange
- the HTTP request/response exchange- Throws:
Exception
-
toString
-