public final class DelegatingAccessDeniedHandler extends Object implements AccessDeniedHandler
AccessDeniedHandler that delegates to other
AccessDeniedHandler instances based upon the type of
AccessDeniedException passed into
handle(HttpServletRequest, HttpServletResponse, AccessDeniedException).| Constructor and Description |
|---|
DelegatingAccessDeniedHandler(LinkedHashMap<Class<? extends AccessDeniedException>,AccessDeniedHandler> handlers,
AccessDeniedHandler defaultHander)
Creates a new instance
|
| Modifier and Type | Method and Description |
|---|---|
void |
handle(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
AccessDeniedException accessDeniedException)
Handles an access denied failure.
|
public DelegatingAccessDeniedHandler(LinkedHashMap<Class<? extends AccessDeniedException>,AccessDeniedHandler> handlers, AccessDeniedHandler defaultHander)
handlers - a map of the AccessDeniedException class to the
AccessDeniedHandler that should be used. Each is
considered in the order they are specified and only the first
AccessDeniedHandler is ued.defaultHander - the default AccessDeniedHandler that should be used if
none of the handlers matches.public void handle(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
AccessDeniedException accessDeniedException)
throws IOException,
javax.servlet.ServletException
AccessDeniedHandlerhandle in interface AccessDeniedHandlerrequest - that resulted in an AccessDeniedExceptionresponse - so that the user agent can be advised of the failureaccessDeniedException - that caused the invocationIOException - in the event of an IOExceptionjavax.servlet.ServletException - in the event of a ServletException