Reputation: 9977
I know that in a standalone application I create one of the application context instances which in turn creates the beans from conf files. But I can not see any such code in dispatched servlet. How then are the beans created in a web application?
Upvotes: 1
Views: 157
Reputation: 597096
The ContextLoaderListener
creates an ApplicationContext
(by delegating to ContextLoader
) and stores it in the servlet context.
So you have to map the ContextLoaderListener
is a <listener>
in web.xml
Then, of course, that ApplicationContext
(WebApplicationContext
in this case) creates the beans.
Upvotes: 6