public class AnonymousFilter extends PathMatchingFilter
[urls]
/user/** = authc
But if you wanted /user/signup/**
to be available to anyone, you have to exclude that path since
it is a subset of the first. This is where the AnonymousFilter ('anon') is useful:
[urls]
/user/signup/** = anon
/user/** = authc
>
Since the url pattern definitions follow a 'first match wins' paradigm, the anon
filter will
match the /user/signup/**
paths and the /user/**
path chain will not be evaluated.appliedPaths, pathMatcher
ALREADY_FILTERED_SUFFIX
filterConfig
Constructor and Description |
---|
AnonymousFilter() |
Modifier and Type | Method and Description |
---|---|
protected boolean |
onPreHandle(ServletRequest request,
ServletResponse response,
Object mappedValue)
Always returns
true allowing unchecked access to the underlying path or resource. |
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 AnonymousFilter()
protected boolean onPreHandle(ServletRequest request, ServletResponse response, Object mappedValue)
true
allowing unchecked access to the underlying path or resource.onPreHandle
in class PathMatchingFilter
request
- the incoming ServletRequestresponse
- the outgoing ServletResponsemappedValue
- the filter-specific config value mapped to this filter in the URL rules mappings.true
always, allowing unchecked access to the underlying path or resource.PathMatchingFilter.isEnabled(javax.servlet.ServletRequest, javax.servlet.ServletResponse, String, Object)
Copyright © 2004-2013 The Apache Software Foundation. All Rights Reserved.