I have written an application using Spring Framework. The application was created over 3 different ApplicationContext(s) linked in a simple hierarchical way using ClassPathXmlApplicationContext. After testing the functionality of the application, I am now ready to integrate it into a web server using Spring MVC.
My challenge is to choose the right ApplicationContext class. It would seem like the natural choice would be to use AnnotationConfigApplicationContext or AnnotationConfigWebApplicationContext because I wish to use the annotation dependency injection features but I see that both of these classes are standalone, that is they can't be linked in a hierachical way.
QUESTION: What choice of ApplicationContext class should I use for my webserver given that I want to keep my backend application in 3 different ApplicationContext classes (the same ClassPathXmlApplicationContext) linked in a hierarchical way?
PS: I am hoping that my webserver application will be on 4 different ApplicationContext classes: 1 for the webserver front-end + 3 others for the backend functionality.


Reply With Quote