• notice
  • Congratulations on the launch of the Sought Tech site

Is there a difference between ApplicationStartedEvent and ContextStartedEvent?

Let me talk to you about this issue today: Is there a difference between ApplicationStartedEvent and ContextStartedEvent?


By the way, it took a few weeks recently to launch SpringForAll Community 3.0. The community building goal is the same as before, hoping to build a high-quality technical community vertical to Java developers! At present, there are nearly 1,000 registered users, and many readers will publish some posts every day, and the technical atmosphere has initially formed. If you are learning Java, Spring, you can share your insights, encountered problems and help others solve problems here. Later, I will continue to select some questions that I find interesting, and I will continue to share them with you here!

Regarding this issue, it is actually the understanding of Spring and Spring Boot event mechanism.

Although Spring Boot is based on Spring, Spring Boot does not directly use the common events defined in Spring, but redefines a batch.

They are all inherited from SpringApplicationEvent, and SpringApplicationEventinherited from ApplicationEventSpringApplicationEventand the title mentioned ContextStartedEventis the same level.

Therefore, it should be useless in Spring Boot ContextStartedEvent的.

What are the specific events of Spring Boot, you can see an article written before when 2.0 was released: "Spring Boot 2.0 New Features (2): New Event ApplicationStartedEvent

ApplicationStartedEvent <= new event

Today's sharing is here! If you encounter difficulties in the learning process? You can join our high-quality Spring technical exchange group , participate in exchanges and discussions, and learn and progress better! More Spring Boot tutorials can be clicked directly! , welcome to collect and forward support!

The above is my understanding. If there is something wrong, please point it out in the comment area, learn and advance together!


Technical otaku

Sought technology together

Related Topic


Leave a Reply