title: Spring + Web MVC: dispatcher-servlet.xml vs. applicationContext.xml (plus shared security)
body: <p>What is the correct way to use the two contexts: <code>dispatcher-servlet.xml</code> and <code>applicationContext.xml</code>? What goes where?</p>
  
  <p>I want to write a fairly typical app deployed in a servlet container. It has some controllers with JSP views. It also has some nontrivial logic on the back-end. Do I really need both contexts? How are they related to each other? How can I decide what to put in which?</p>
  
  <p>Also, I want to use Spring-security for my application. I may want to use its features (like declarative security with annotations) in web controllers as well as in deeper layers. How should I configure security to work in this case? Should it be in one of those files (which?), or both?</p>