|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.shiro.web.filter.mgt.PathMatchingFilterChainResolver
public class PathMatchingFilterChainResolver
A FilterChainResolver
that resolves FilterChain
s based on url path
matching, as determined by a configurable PathMatcher
.
FilterChainManager
for all configured filter chains (keyed
by configured path pattern). If an incoming Request path matches one of the configured path patterns (via
the PathMatcher
, the corresponding configured FilterChain
is returned.
Constructor Summary | |
---|---|
PathMatchingFilterChainResolver()
|
|
PathMatchingFilterChainResolver(FilterConfig filterConfig)
|
Method Summary | |
---|---|
FilterChain |
getChain(ServletRequest request,
ServletResponse response,
FilterChain originalChain)
Returns the filter chain that should be executed for the given request, or null if the
original chain should be used. |
FilterChainManager |
getFilterChainManager()
|
PatternMatcher |
getPathMatcher()
Returns the PatternMatcher used when determining if an incoming request's path
matches a configured filter chain. |
protected String |
getPathWithinApplication(ServletRequest request)
Merely returns WebUtils.
and can be overridden by subclasses for custom request-to-application-path resolution behavior. |
protected boolean |
pathMatches(String pattern,
String path)
Returns true if an incoming request path (the path argument)
matches a configured filter chain path (the pattern argument), false otherwise. |
void |
setFilterChainManager(FilterChainManager filterChainManager)
|
void |
setPathMatcher(PatternMatcher pathMatcher)
Sets the PatternMatcher used when determining if an incoming request's path
matches a configured filter chain. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PathMatchingFilterChainResolver()
public PathMatchingFilterChainResolver(FilterConfig filterConfig)
Method Detail |
---|
public PatternMatcher getPathMatcher()
PatternMatcher
used when determining if an incoming request's path
matches a configured filter chain. Unless overridden, the
default implementation is an AntPathMatcher
.
PatternMatcher
used when determining if an incoming request's path
matches a configured filter chain.public void setPathMatcher(PatternMatcher pathMatcher)
PatternMatcher
used when determining if an incoming request's path
matches a configured filter chain. Unless overridden, the
default implementation is an AntPathMatcher
.
pathMatcher
- the PatternMatcher
used when determining if an incoming request's path
matches a configured filter chain.public FilterChainManager getFilterChainManager()
public void setFilterChainManager(FilterChainManager filterChainManager)
public FilterChain getChain(ServletRequest request, ServletResponse response, FilterChain originalChain)
FilterChainResolver
null
if the
original chain should be used.
This method allows a implementation to define arbitrary security Filter
chains for any given request or URL pattern.
getChain
in interface FilterChainResolver
request
- the incoming ServletRequestresponse
- the outgoing ServletResponseoriginalChain
- the original FilterChain
intercepted by the ShiroFilter implementation.
null
if the
original chain should be used.protected boolean pathMatches(String pattern, String path)
true
if an incoming request path (the path
argument)
matches a configured filter chain path (the pattern
argument), false
otherwise.
Simply delegates to
getPathMatcher()
.matches(pattern,path)
.
Subclass implementors should think carefully before overriding this method, as typically a custom
PathMatcher
should be configured for custom path matching behavior instead. Favor OO composition
rather than inheritance to limit your exposure to Shiro implementation details which may change over time.
pattern
- the pattern to match againstpath
- the value to match with the specified pattern
true
if the request path
matches the specified filter chain url pattern
,
false
otherwise.protected String getPathWithinApplication(ServletRequest request)
WebUtils.getPathWithinApplication(request)
and can be overridden by subclasses for custom request-to-application-path resolution behavior.
request
- the incoming ServletRequest
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |