ContextLoadListener and DispatcherServlet

Is it possible to define both ContextLoadListener and DispatcherServlet in web.xml or are they mutually exclusive?

+1
source share
1 answer

No, they are not mutually exclusive.

ContextLoaderListenercontrols the appcontext, which is associated with all webapp. DispatcherServletmanages the context associated with this particular servlet. The webapp context is the “parent” context of the servlet application, and all the beans in the appapptext of the webapp application are visible in the context of the servlet application.

, ContextLoaderListener. , beans webbapp, , .

+5

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


All Articles