shiro的拦截器执行过程
shiro的拦截器执行过程
找到当前的request对应的过滤器链
internalDoFilter:193, ApplicationFilterChain (org.apache.catalina.core) [6]
doFilter:125, OncePerRequestFilter (org.apache.shiro.web.servlet)
doFilterInternal:362, AbstractShiroFilter (org.apache.shiro.web.servlet)
AbstractShiroFilter.executeChain
AbstractShiroFilter.getExecutionChain
DefaultFilterChainManager.proxy
NamedFilterList.proxy
SimpleNamedFilterList.proxy
ProxiedFilterChain.doFilter
AbstractShiroFilter.getExecutionChain
AbstractShiroFilter.executeChain
判断过滤器是否能够被启用
FilterChain.doFilter
ProxiedFilterChain.doFilter
OncePerRequestFilter.doFilter
OncePerRequestFilter.doFilterInternal
做URL匹配
AdviceFilter.doFilterInternal
AdviceFilter.preHandle
PathMatchingFilter.preHandle
PathMatchingFilter.pathsMatch:124
PathMatchingFilter.pathsMatch:141
AntPathMatcher.matches 做URL匹配
PathMatchingFilter.isFilterChainContinued
AnonymousFilter.onPreHandle:匿名拦截器,通过静态资源
AccessControlFilter.onPreHandle -> isAccessAllowed() || onAccessDenied()
AuthenticationFilter.isAccessAllowed:判断用户是否在线
AdviceFilter.doFilterInternal 匹配完成
AdviceFilter.executeChain
这是进入方法转发到Controller的过程
ProxiedFilterChain.doFilter
ApplicationFilterChain.doFilter
ApplicationFilterChain.internalDoFilter
WsFilter.doFilter
ApplicationFilterChain.doFilter
FrameworkServlet.service
这个是完整的调用链条
这是进入方法转发到Controller的过程
login:60, LoginController (im.zhaojun.system.controller)
invoke0:-1, NativeMethodAccessorImpl (sun.reflect)
invoke:62, NativeMethodAccessorImpl (sun.reflect)
invoke:43, DelegatingMethodAccessorImpl (sun.reflect)
invoke:498, Method (java.lang.reflect)
doInvoke:209, InvocableHandlerMethod (org.springframework.web.method.support)
invokeForRequest:136, InvocableHandlerMethod (org.springframework.web.method.support)
invokeAndHandle:102, ServletInvocableHandlerMethod (org.springframework.web.servlet.mvc.method.annotation)
invokeHandlerMethod:891, RequestMappingHandlerAdapter (org.springframework.web.servlet.mvc.method.annotation)
handleInternal:797, RequestMappingHandlerAdapter (org.springframework.web.servlet.mvc.method.annotation)
handle:87, AbstractHandlerMethodAdapter (org.springframework.web.servlet.mvc.method)
doDispatch:991, DispatcherServlet (org.springframework.web.servlet)
doService:925, DispatcherServlet (org.springframework.web.servlet)
processRequest:974, FrameworkServlet (org.springframework.web.servlet)
doPost:877, FrameworkServlet (org.springframework.web.servlet)
service:661, HttpServlet (javax.servlet.http)
service:851, FrameworkServlet (org.springframework.web.servlet)
service:742, HttpServlet (javax.servlet.http)
internalDoFilter:231, ApplicationFilterChain (org.apache.catalina.core) [8]
doFilter:166, ApplicationFilterChain (org.apache.catalina.core)
doFilter:52, WsFilter (org.apache.tomcat.websocket.server)
internalDoFilter:193, ApplicationFilterChain (org.apache.catalina.core) [7]
doFilter:166, ApplicationFilterChain (org.apache.catalina.core)
这是在Shiro中进行URL校验的过程
doFilter:61, ProxiedFilterChain (org.apache.shiro.web.servlet)
executeChain:108, AdviceFilter (org.apache.shiro.web.servlet)
doFilterInternal:137, AdviceFilter (org.apache.shiro.web.servlet)
doFilter:125, OncePerRequestFilter (org.apache.shiro.web.servlet)
doFilter:66, ProxiedFilterChain (org.apache.shiro.web.servlet)
executeChain:449, AbstractShiroFilter (org.apache.shiro.web.servlet)
call:365, AbstractShiroFilter$1 (org.apache.shiro.web.servlet)
doCall:90, SubjectCallable (org.apache.shiro.subject.support)
call:83, SubjectCallable (org.apache.shiro.subject.support)
execute:387, DelegatingSubject (org.apache.shiro.subject.support)
doFilterInternal:362, AbstractShiroFilter (org.apache.shiro.web.servlet)
doFilter:125, OncePerRequestFilter (org.apache.shiro.web.servlet)
这是Spring和Tomcat中,进行filter过滤器的选择调用过程
internalDoFilter:193, ApplicationFilterChain (org.apache.catalina.core) [6]
doFilter:166, ApplicationFilterChain (org.apache.catalina.core)
doFilter:123, WebStatFilter (com.alibaba.druid.support.http)
internalDoFilter:193, ApplicationFilterChain (org.apache.catalina.core) [5]
doFilter:166, ApplicationFilterChain (org.apache.catalina.core)
doFilterInternal:99, RequestContextFilter (org.springframework.web.filter)
doFilter:107, OncePerRequestFilter (org.springframework.web.filter)
internalDoFilter:193, ApplicationFilterChain (org.apache.catalina.core) [4]
doFilter:166, ApplicationFilterChain (org.apache.catalina.core)
doFilterInternal:109, HttpPutFormContentFilter (org.springframework.web.filter)
doFilter:107, OncePerRequestFilter (org.springframework.web.filter)
internalDoFilter:193, ApplicationFilterChain (org.apache.catalina.core) [3]
doFilter:166, ApplicationFilterChain (org.apache.catalina.core)
doFilterInternal:93, HiddenHttpMethodFilter (org.springframework.web.filter)
doFilter:107, OncePerRequestFilter (org.springframework.web.filter)
internalDoFilter:193, ApplicationFilterChain (org.apache.catalina.core) [2]
doFilter:166, ApplicationFilterChain (org.apache.catalina.core)
doFilterInternal:200, CharacterEncodingFilter (org.springframework.web.filter)
doFilter:107, OncePerRequestFilter (org.springframework.web.filter)
internalDoFilter:193, ApplicationFilterChain (org.apache.catalina.core) [1]
doFilter:166, ApplicationFilterChain (org.apache.catalina.core)
invoke:198, StandardWrapperValve (org.apache.catalina.core)
invoke:96, StandardContextValve (org.apache.catalina.core)
invoke:493, AuthenticatorBase (org.apache.catalina.authenticator)
invoke:140, StandardHostValve (org.apache.catalina.core)
invoke:81, ErrorReportValve (org.apache.catalina.valves)
invoke:87, StandardEngineValve (org.apache.catalina.core)
service:342, CoyoteAdapter (org.apache.catalina.connector)
service:800, Http11Processor (org.apache.coyote.http11)
process:66, AbstractProcessorLight (org.apache.coyote)
process:806, AbstractProtocol$ConnectionHandler (org.apache.coyote)
doRun:1498, NioEndpoint$SocketProcessor (org.apache.tomcat.util.net)
run:49, SocketProcessorBase (org.apache.tomcat.util.net)
runWorker:1149, ThreadPoolExecutor (java.util.concurrent)
run:624, ThreadPoolExecutor$Worker (java.util.concurrent)
run:61, TaskThread$WrappingRunnable (org.apache.tomcat.util.threads)
run:748, Thread (java.lang)