Class RequestMatcherDelegatingAccessDeniedHandler
- java.lang.Object
-
- org.springframework.security.web.access.RequestMatcherDelegatingAccessDeniedHandler
-
- All Implemented Interfaces:
AccessDeniedHandler
public final class RequestMatcherDelegatingAccessDeniedHandler extends java.lang.Object implements AccessDeniedHandler
AnAccessDeniedHandlerthat delegates to otherAccessDeniedHandlerinstances based upon the type ofHttpServletRequestpassed intohandle(HttpServletRequest, HttpServletResponse, AccessDeniedException).- Since:
- 5.1
-
-
Constructor Summary
Constructors Constructor Description RequestMatcherDelegatingAccessDeniedHandler(java.util.LinkedHashMap<RequestMatcher,AccessDeniedHandler> handlers, AccessDeniedHandler defaultHandler)Creates a new instance
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidhandle(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, AccessDeniedException accessDeniedException)Handles an access denied failure.
-
-
-
Constructor Detail
-
RequestMatcherDelegatingAccessDeniedHandler
public RequestMatcherDelegatingAccessDeniedHandler(java.util.LinkedHashMap<RequestMatcher,AccessDeniedHandler> handlers, AccessDeniedHandler defaultHandler)
Creates a new instance- Parameters:
handlers- a map ofRequestMatchers toAccessDeniedHandlers that should be used. Each is considered in the order they are specified and only the firstAccessDeniedHandleris used.defaultHandler- the defaultAccessDeniedHandlerthat should be used if none of the matchers match.
-
-
Method Detail
-
handle
public void handle(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, AccessDeniedException accessDeniedException) throws java.io.IOException, javax.servlet.ServletExceptionDescription copied from interface:AccessDeniedHandlerHandles an access denied failure.- Specified by:
handlein interfaceAccessDeniedHandler- Parameters:
request- that resulted in anAccessDeniedExceptionresponse- so that the user agent can be advised of the failureaccessDeniedException- that caused the invocation- Throws:
java.io.IOException- in the event of an IOExceptionjavax.servlet.ServletException- in the event of a ServletException
-
-