What type of information should be present in the dispatcher-servlet.xml and applicationContext.xml?
-
possible duplicate of Spring + Web MVC: dispatcher-servlet.xml vs. applicationContext.xml (plus shared security)Pradeep Kr Kaushal– Pradeep Kr Kaushal2014-01-31 07:10:34 +00:00Commented Jan 31, 2014 at 7:10
-
Possible duplicate of stackoverflow.com/questions/16458754/…Pradeep Kr Kaushal– Pradeep Kr Kaushal2014-01-31 07:10:38 +00:00Commented Jan 31, 2014 at 7:10
Add a comment
|
1 Answer
The applicationContext.xml is loaded by the ContextLoadeListener and should contain your shared/global beans. Things like the datasource, jms connecetionfactories, services, repositories etc.
Your dispatcher-servlet.xml is loaded by the DispatcherServlet and should contain only web related things like controllers, viewresolvers, exceptionhandlers etc.
This is a general rule of thumb of course.