public class UserFilter extends AccessControlFilter
loginUrl
DEFAULT_LOGIN_URL, GET_METHOD, POST_METHOD
appliedPaths, pathMatcher
ALREADY_FILTERED_SUFFIX
filterConfig
Constructor and Description |
---|
UserFilter() |
Modifier and Type | Method and Description |
---|---|
protected boolean |
isAccessAllowed(ServletRequest request,
ServletResponse response,
Object mappedValue)
Returns
true if the request is a
loginRequest or
if the current subject
is not null , false otherwise. |
protected boolean |
onAccessDenied(ServletRequest request,
ServletResponse response)
This default implementation simply calls
saveRequestAndRedirectToLogin
and then immediately returns false , thereby preventing the chain from continuing so the redirect may
execute. |
getLoginUrl, getSubject, isLoginRequest, onAccessDenied, onPreHandle, redirectToLogin, saveRequest, saveRequestAndRedirectToLogin, setLoginUrl
getPathWithinApplication, isEnabled, pathsMatch, pathsMatch, preHandle, processPathConfig
afterCompletion, cleanup, doFilterInternal, executeChain, postHandle
doFilter, getAlreadyFilteredAttributeName, isEnabled, isEnabled, setEnabled, shouldNotFilter
getName, setName, toStringBuilder
destroy, getFilterConfig, getInitParam, init, onFilterConfigSet, setFilterConfig
getContextAttribute, getContextInitParam, getServletContext, removeContextAttribute, setContextAttribute, setServletContext, toString
public UserFilter()
protected boolean isAccessAllowed(ServletRequest request, ServletResponse response, Object mappedValue)
true
if the request is a
loginRequest
or
if the current subject
is not null
, false
otherwise.isAccessAllowed
in class AccessControlFilter
request
- the incoming ServletRequest
response
- the outgoing ServletResponse
mappedValue
- the filter-specific config value mapped to this filter in the URL rules mappings.true
if the request is a
loginRequest
or
if the current subject
is not null
, false
otherwise.protected boolean onAccessDenied(ServletRequest request, ServletResponse response) throws Exception
saveRequestAndRedirectToLogin
and then immediately returns false
, thereby preventing the chain from continuing so the redirect may
execute.onAccessDenied
in class AccessControlFilter
request
- the incoming ServletRequest
response
- the outgoing ServletResponse
true
if the request should continue to be processed; false if the subclass will
handle/render the response directly.Exception
- if there is an error processing the request.Copyright © 2004–2020 The Apache Software Foundation. All rights reserved.