Spring Boot 版本:Spring Boot 2.1.6.RELEASE 版本下解析的。

1.为什么在ServletContextInitializer中定义的Bean没有日志?而在ServletRegistrationBean中定义的Bean有日志提现?

1)首先查看 org.springframework.boot.web.servlet.ServletContextInitializer 的代码:

为什么在ServletContextInitializer中定义的Bean没有日志?

2)对 onStartUp进行调用链查找。

为什么在ServletContextInitializer中定义的Bean没有日志?

org.springframework.boot.web.embedded.tomcat.TomcatStarter.java

为什么在ServletContextInitializer中定义的Bean没有日志?

 

为什么在ServletContextInitializer中定义的Bean没有日志?

追踪到 org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.java

为什么在ServletContextInitializer中定义的Bean没有日志?

TODO:还没写完,我再捋捋.....

相关文章:

  • 2021-07-14
  • 2022-12-23
  • 2022-12-23
  • 2021-11-17
  • 2021-05-06
  • 2022-02-27
  • 2021-06-30
  • 2021-07-24
猜你喜欢
  • 2022-02-07
  • 2022-02-06
  • 2022-01-17
  • 2021-05-04
  • 2021-05-18
  • 2021-11-24
  • 2021-08-23
相关资源
相似解决方案