Add methods to prepend WebFilter + WebExceptionHandler
This commit is contained in:
parent
2cd6240dab
commit
1c9d4deba2
|
@ -131,7 +131,7 @@ public class WebHttpHandlerBuilder {
|
|||
|
||||
|
||||
/**
|
||||
* Add the given filters to use for processing requests.
|
||||
* Add the given filters.
|
||||
* @param filters the filters to add
|
||||
*/
|
||||
public WebHttpHandlerBuilder filters(List<? extends WebFilter> filters) {
|
||||
|
@ -142,7 +142,17 @@ public class WebHttpHandlerBuilder {
|
|||
}
|
||||
|
||||
/**
|
||||
* Add the given exception handler to apply at the end of request processing.
|
||||
* Insert the given filter before other configured filters.
|
||||
* @param filter the filters to insert
|
||||
*/
|
||||
public WebHttpHandlerBuilder prependFilter(WebFilter filter) {
|
||||
Assert.notNull(filter, "WebFilter is required");
|
||||
this.filters.add(0, filter);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the given exception handlers.
|
||||
* @param handlers the exception handlers
|
||||
*/
|
||||
public WebHttpHandlerBuilder exceptionHandlers(List<WebExceptionHandler> handlers) {
|
||||
|
@ -152,6 +162,16 @@ public class WebHttpHandlerBuilder {
|
|||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Insert the given exception handler before other configured handlers.
|
||||
* @param handler the exception handler to insert
|
||||
*/
|
||||
public WebHttpHandlerBuilder prependExceptionHandler(WebExceptionHandler handler) {
|
||||
Assert.notNull(handler, "WebExceptionHandler is required");
|
||||
this.exceptionHandlers.add(0, handler);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Configure the {@link WebSessionManager} to set on the
|
||||
* {@link ServerWebExchange WebServerExchange}.
|
||||
|
|
Loading…
Reference in New Issue