Class DelegatingAccessDeniedHandler
- java.lang.Object
-
- org.springframework.security.web.access.DelegatingAccessDeniedHandler
-
- All Implemented Interfaces:
AccessDeniedHandler
public final class DelegatingAccessDeniedHandler extends java.lang.Object implements AccessDeniedHandler
AnAccessDeniedHandler
that delegates to otherAccessDeniedHandler
instances based upon the type ofAccessDeniedException
passed intohandle(HttpServletRequest, HttpServletResponse, AccessDeniedException)
.- Since:
- 3.2
-
-
Constructor Summary
Constructors Constructor Description DelegatingAccessDeniedHandler(java.util.LinkedHashMap<java.lang.Class<? extends AccessDeniedException>,AccessDeniedHandler> handlers, AccessDeniedHandler defaultHandler)
Creates a new instance
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
handle(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, AccessDeniedException accessDeniedException)
Handles an access denied failure.
-
-
-
Constructor Detail
-
DelegatingAccessDeniedHandler
public DelegatingAccessDeniedHandler(java.util.LinkedHashMap<java.lang.Class<? extends AccessDeniedException>,AccessDeniedHandler> handlers, AccessDeniedHandler defaultHandler)
Creates a new instance- Parameters:
handlers
- a map of theAccessDeniedException
class to theAccessDeniedHandler
that should be used. Each is considered in the order they are specified and only the firstAccessDeniedHandler
is ued.defaultHandler
- the defaultAccessDeniedHandler
that should be used if none of the handlers matches.
-
-
Method Detail
-
handle
public void handle(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, AccessDeniedException accessDeniedException) throws java.io.IOException, javax.servlet.ServletException
Description copied from interface:AccessDeniedHandler
Handles an access denied failure.- Specified by:
handle
in interfaceAccessDeniedHandler
- Parameters:
request
- that resulted in anAccessDeniedException
response
- 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
-
-