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
`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 and Description
`ResponseCodeHandler(int responseCode)` Construct a new instance.

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `handleRequest(HttpServerExchange exchange)` Handle the request.
`String` `toString()`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### 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.

### Constructor Detail

#### ResponseCodeHandler

    public ResponseCodeHandler(int responseCode)

Construct a new instance.

Parameters:
  `responseCode` - the response code to set

### Method Detail

#### handleRequest

    public void handleRequest(HttpServerExchange exchange)
                       throws Exception

Description copied from interface: `HttpHandler`
Handle the request.

Specified by:
  `handleRequest` in interface `HttpHandler`
Parameters:
  `exchange` - the HTTP request/response exchange
Throws:
  `Exception`

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`