org.springframework.web.server.handler.FilteringWebHandler Java Examples

The following examples show how to use org.springframework.web.server.handler.FilteringWebHandler. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: WebHttpHandlerBuilder.java    From spring-analysis-note with MIT License 6 votes vote down vote up
/**
 * Build the {@link HttpHandler}.
 */
public HttpHandler build() {

	WebHandler decorated = new FilteringWebHandler(this.webHandler, this.filters);
	decorated = new ExceptionHandlingWebHandler(decorated,  this.exceptionHandlers);

	HttpWebHandlerAdapter adapted = new HttpWebHandlerAdapter(decorated);
	if (this.sessionManager != null) {
		adapted.setSessionManager(this.sessionManager);
	}
	if (this.codecConfigurer != null) {
		adapted.setCodecConfigurer(this.codecConfigurer);
	}
	if (this.localeContextResolver != null) {
		adapted.setLocaleContextResolver(this.localeContextResolver);
	}
	if (this.forwardedHeaderTransformer != null) {
		adapted.setForwardedHeaderTransformer(this.forwardedHeaderTransformer);
	}
	if (this.applicationContext != null) {
		adapted.setApplicationContext(this.applicationContext);
	}
	adapted.afterPropertiesSet();

	return adapted;
}
 
Example #2
Source File: WebHttpHandlerBuilder.java    From java-technology-stack with MIT License 6 votes vote down vote up
/**
 * Build the {@link HttpHandler}.
 */
public HttpHandler build() {

	WebHandler decorated = new FilteringWebHandler(this.webHandler, this.filters);
	decorated = new ExceptionHandlingWebHandler(decorated,  this.exceptionHandlers);

	HttpWebHandlerAdapter adapted = new HttpWebHandlerAdapter(decorated);
	if (this.sessionManager != null) {
		adapted.setSessionManager(this.sessionManager);
	}
	if (this.codecConfigurer != null) {
		adapted.setCodecConfigurer(this.codecConfigurer);
	}
	if (this.localeContextResolver != null) {
		adapted.setLocaleContextResolver(this.localeContextResolver);
	}
	if (this.forwardedHeaderTransformer != null) {
		adapted.setForwardedHeaderTransformer(this.forwardedHeaderTransformer);
	}
	if (this.applicationContext != null) {
		adapted.setApplicationContext(this.applicationContext);
	}
	adapted.afterPropertiesSet();

	return adapted;
}
 
Example #3
Source File: WebTestHandler.java    From spring-security-reactive with Apache License 2.0 4 votes vote down vote up
public static WebTestHandler bindToWebFilters(WebFilter... filters) {
	return new WebTestHandler(new FilteringWebHandler(exchange -> Mono.empty(), Arrays.asList(filters)));
}