How a web container controls the life cycle of a spring controller

If I write a simple servlet application, in my servlet class I extend the HTTP servlet. This allows the container to know that my class is a servlet, and it will manage the servlet's life cycle. init, doget (), destroy (), etc.

But the Spring MVC class framweork controller does not extend the servlet class. this is jsut POJO with its own custom methods. Now I can call these methods individually using Requestmapping.

But will this Spring class be “managed” by the container in the same way that the servlet life cycle is managed?

+3
source share
1 answer

Source: https://habr.com/ru/post/1545687/


All Articles