Module io.inverno.mod.web.server
Package io.inverno.mod.web.server
Class WhiteLabelErrorRoutesConfigurer<A extends ExchangeContext>
java.lang.Object
io.inverno.mod.web.server.WhiteLabelErrorRoutesConfigurer<A>
- Type Parameters:
A
- the exchange context type
- All Implemented Interfaces:
ErrorWebRouter.Configurer<A>
public class WhiteLabelErrorRoutesConfigurer<A extends ExchangeContext>
extends Object
implements ErrorWebRouter.Configurer<A>
Configures white label error routes handling common HTTP errors and responding with application/json
, text/html
or text/plain
.
This provides a simple and convenient way to handle errors in a Web server on an environment where exposing stacktrace is not a security concern. It is however recommended to provide proper error handlers that comply with security policies.
- Since:
- 1.12
- Author:
- Jeremy Kuhn
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
configure
(ErrorWebRouter<A> routes) Configures error Web routes.
-
Constructor Details
-
WhiteLabelErrorRoutesConfigurer
public WhiteLabelErrorRoutesConfigurer()
-
-
Method Details
-
configure
Description copied from interface:ErrorWebRouter.Configurer
Configures error Web routes.
- Specified by:
configure
in interfaceErrorWebRouter.Configurer<A extends ExchangeContext>
- Parameters:
routes
- the error Web router to use to define error Web routes
-