Servlet.init() and Filter.init() call sequence

前端 未结 4 403
[愿得一人]
[愿得一人] 2021-01-31 16:48

In which order are Servlet.init() and Filter.init() methods called in java web application? Which one is called first? Are all Servlet.init() methods called before than any Filt

4条回答
  •  春和景丽
    2021-01-31 17:12

    1. For all filters: Filter.init()
    2. For all servlets with in web.xml: Servlet.init()
    3. For all applicable filters for request: Filter.doFilter()
    4. If applicable servlet not already initialised: Servlet.init()
    5. For applicable servlet: Servlet.service()

提交回复
热议问题