Search
Duplicate
๐ŸŒซ๏ธ

filter ์ „ ํ๋ฆ„

1.
Http11Processor ์—์„œ ์‹œ์ž‘!
a.
getHandler().service(request, response)
b.
handler ๋Š” ์ฝ”์š”ํ…Œ ํ•ธ๋“ค๋Ÿฌ
c.
request ์™€ response ๋Š” ์ƒ์„ฑ์ž(AbstractProcessor)์—์„œ ์ƒ์„ฑํ•จ!
2.
catalina ์—์„œ Valve ๋“ค์ด ์ฐจ๋ก€๋กœ ์‹คํ–‰๋จ!
3.
StandardWrapperValve ์—์„œ ApplicationFilterChain ์˜ doFilter ๋ฅผ ์‹คํ–‰
a.
ApplicationFilterChain ์—๋Š” filters ๋“ค์ด ์žˆ์Œ!
4.
ApplicationFilterCahin ์˜ doFilter ์—์„œ internalDoFilter ๋ฅผ ํ˜ธ์ถœ
5.
์—ฌ๊ธฐ์„œ filter ๋“ค๋งˆ๋‹ค doFilter ์‹คํ–‰!
a.
์—ฌ๊ธฐ๊ฐ€ ํ…Œ์ฝ”ํ†ก์—์„œ ๋‚˜์™”๋˜ pos ๋ถ€๋ถ„
1.
Thread run() ์•ˆ์˜ target.run()
2.
TaskThread (Thread ๋ฅผ ์ƒ์†) ์˜ WrappedRunnable ์˜ run() ์‹คํ–‰
3.
ThreadPoolExecutor ๋‚ด๋ถ€์˜ run ์‹คํ–‰
4.
SocketProcessorBase ์˜ doRun()
5.
NioEndPoint ์˜ SocketProcessor ์˜ process() ์‹คํ–‰
6.
AbstractProtocol$ConnectionHandler ์˜ process() ์‹คํ–‰
7.
AbstractProtocolLight service() ์‹คํ–‰
8.
Http11Processor(AbstractProcessor) ์˜ service() ์‹คํ–‰
9.
CoyoteAdapter ์˜ invoke() ์‹คํ–‰
10.
Valve ๋“ค chaining
a.
StandardEngineValve
b.
Host
c.
Context
d.
Wrapper
11.
StandardWrapperValve ์—์„œ filterChain.doFilter ์‹คํ–‰
a.
filterChain ์—๋Š” filters ์™€ dispatcher servlet ์žˆ์Œ
12.
filter chaining
a.
ApplicationFilterChain doFilter() โ†’ AFC doFilterInternal() โ†’ OncePerRequestFilter doFilter() โ†’ ๋“ฑ๋ก๋œ Filter doFilterInternal() ์ˆœํ™˜
13.
pos ๊ฐ€ n ๋ณด๋‹ค ํฌ๋ฉด servlet.service() ์‹คํ–‰
14.
HttpServlet service()
15.
FrameworkServlet ์—์„œ doGet() ๊ณผ processRequest() ์‹คํ–‰
16.
DispatcherServlet ๋„์ฐฉ
2, 3์€ tomcat.util.threads
4, 5 ๋Š” tomcat.util.net
6, 7 ์€ tomcat.coyote
8 ์€ tomcat.coyote.http11
9 ๋Š” tomcat.catalina.connector
10 ์€ tomcat.catalina.core
ApplicationFilterChain ์€ tomcat.catalina.core
OncePerRequestFilter ๋Š” springframework.web.filter
HttpServlet ์€ javax.servlet.http
FrameworkServlet ์€ springframework.web.servlet