Class DelegatingAccessDeniedHandler
java.lang.Object
org.springframework.security.web.access.DelegatingAccessDeniedHandler
- All Implemented Interfaces:
AccessDeniedHandler
An
AccessDeniedHandler that delegates to other AccessDeniedHandler
instances based upon the type of AccessDeniedException passed into
handle(HttpServletRequest, HttpServletResponse, AccessDeniedException).- Since:
- 3.2
-
Constructor Summary
ConstructorsConstructorDescriptionDelegatingAccessDeniedHandler(LinkedHashMap<Class<? extends AccessDeniedException>, AccessDeniedHandler> handlers, AccessDeniedHandler defaultHandler) Creates a new instance -
Method Summary
Modifier and TypeMethodDescriptionvoidhandle(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, AccessDeniedException accessDeniedException) Handles an access denied failure.
-
Constructor Details
-
DelegatingAccessDeniedHandler
public DelegatingAccessDeniedHandler(LinkedHashMap<Class<? extends AccessDeniedException>, AccessDeniedHandler> handlers, AccessDeniedHandler defaultHandler) Creates a new instance- Parameters:
handlers- a map of theAccessDeniedExceptionclass to theAccessDeniedHandlerthat should be used. Each is considered in the order they are specified and only the firstAccessDeniedHandleris ued.defaultHandler- the defaultAccessDeniedHandlerthat should be used if none of the handlers matches.
-
-
Method Details
-
handle
public void handle(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, AccessDeniedException accessDeniedException) throws IOException, jakarta.servlet.ServletException Description 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:
IOException- in the event of an IOExceptionjakarta.servlet.ServletException- in the event of a ServletException
-