config/src/main/java/org/springframework/security/config/annotation/web/configurers/ExceptionHandlingConfigurer.java
public ExceptionHandlingConfigurer<H> defaultAccessDeniedHandlerFor(
			AccessDeniedHandler deniedHandler, RequestMatcher preferredMatcher) {
		this.defaultDeniedHandlerMappings.put(preferredMatcher, deniedHandler);
		return this;
	}
public ExceptionHandlingConfigurer<H> defaultAccessDeniedHandlerFor(
			AccessDeniedHandler deniedHandler, RequestMatcher preferredMatcher) {
		this.defaultDeniedHandlerMappings.put(preferredMatcher, deniedHandler);
		return this;
	}
public ExceptionHandlingConfigurer < H > defaultAccessDeniedHandlerFor ( AccessDeniedHandler deniedHandler , RequestMatcher preferredMatcher ) { this . defaultDeniedHandlerMappings . put ( preferredMatcher , deniedHandler ) ; return this ; }
Sets a default {@link AccessDeniedHandler} to be used which prefers being
invoked for the provided {@link RequestMatcher}. If only a single default
{@link AccessDeniedHandler} is specified, it will be what is used for the
default {@link AccessDeniedHandler}. If multiple default
{@link AccessDeniedHandler} instances are configured, then a
{@link RequestMatcherDelegatingAccessDeniedHandler} will be used.

@param deniedHandler the {@link AccessDeniedHandler} to use
@param preferredMatcher the {@link RequestMatcher} for this default
{@link AccessDeniedHandler}
@return the {@link ExceptionHandlingConfigurer} for further customizations
@since 5.1
Sets a default { @link AccessDeniedHandler } to be used which prefers being invoked for the provided { @link RequestMatcher } . If only a single default { @link AccessDeniedHandler } is specified it will be what is used for the default { @link AccessDeniedHandler } . If multiple default { @link AccessDeniedHandler } instances are configured then a { @link RequestMatcherDelegatingAccessDeniedHandler } will be used .