Top Description Fields Constructors Methods
io.undertow.server.handlers

public final Class ResponseCodeHandler

extends Object
implements HttpHandler
Class Inheritance
All Implemented Interfaces
io.undertow.server.HttpHandler
Imports
io.undertow.UndertowLogger, io.undertow.server.HttpHandler, .HttpServerExchange

A handler which simply sets a response code.
Author
David M. Lloyd

Field Summary

Modifier and TypeField and Description
private static final boolean
public static final ResponseCodeHandler
HANDLE_200

A handler which sets a 200 code.

public static final ResponseCodeHandler
HANDLE_403

A handler which sets a 403 code.

public static final ResponseCodeHandler
HANDLE_404

A handler which sets a 404 code.

public static final ResponseCodeHandler
HANDLE_405

A handler which sets a 405 code.

public static final ResponseCodeHandler
HANDLE_406

A handler which sets a 406 code.

public static final ResponseCodeHandler
HANDLE_500

A handler which sets a 500 code.

private final int

Constructor Summary

AccessConstructor and Description
public
ResponseCodeHandler(final int
the response code to set
responseCode
)

Construct a new instance.

Method Summary

Modifier and TypeMethod and Description
public void
handleRequest(final HttpServerExchange
the HTTP request/response exchange
exchange
)

Implements io.undertow.server.HttpHandler.handleRequest.

Handle the request.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

debugEnabledback to summary
private static final boolean debugEnabled
HANDLE_200back to summary
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_403back to summary
public static final ResponseCodeHandler HANDLE_403

A handler which sets a 403 code.

HANDLE_404back to summary
public static final ResponseCodeHandler HANDLE_404

A handler which sets a 404 code.

HANDLE_405back to summary
public static final ResponseCodeHandler HANDLE_405

A handler which sets a 405 code.

HANDLE_406back to summary
public static final ResponseCodeHandler HANDLE_406

A handler which sets a 406 code.

HANDLE_500back to summary
public static final ResponseCodeHandler HANDLE_500

A handler which sets a 500 code.

responseCodeback to summary
private final int responseCode

Constructor Detail

ResponseCodeHandlerback to summary
public ResponseCodeHandler(final int responseCode)

Construct a new instance.

Parameters
responseCode:int

the response code to set

Method Detail

handleRequestback to summary
public void handleRequest(final HttpServerExchange exchange) throws Exception

Implements io.undertow.server.HttpHandler.handleRequest.

Doc from io.undertow.server.HttpHandler.handleRequest.

Handle the request.

Parameters
exchange:HttpServerExchange

the HTTP request/response exchange

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override