title: How does the DispatcherServlet, Resolver and Controllers interact?
body: <p>Ok so I have encountered the fairly common errror:</p>
  
  <p><code>WARNING: No mapping found for HTTP request with URI [/WEB-INF/jsp/index.jsp] in DispatcherServlet with name 'app'</code></p>
  
  <p>I'm looking at the existing answers and I've not seen a really good explanation of how the components interact. Seeing as I can't solve my issue based on the existing answers, I'm hoping someone can provide a detailed explanation of the function of <code>DispatcherServlet</code> and <code>Resolver</code>s.</p>
  
  <p>Developing in Eclipse, I have the following structure:</p>
  
  <pre><code>/src/com/whiuk/philip/web/controller/IndexController.java
  /WebContent
  /WebContent/WEB-INF
  /WebContent/WEB-INF/web.xml
  /WebContent/WEB-INF/app-servlet.xml
  /WebContent/WEB-INF/jsp/index.jsp
  </code></pre>
  
  <p>Eclipse Deployment Assembly means it deploys as follows:</p>
  
  <pre><code>/src -&gt; WEB-INF/classes
  /WebContent -&gt; /
  /ivy.xml[*] -&gt; WEB-INF/lib
  </code></pre>
  
  <p>I have a <strong>web.xml</strong> file that defines a <code>DispatcherServlet</code> and a mapping to all files (<code>/*</code>)</p>
  
  <pre><code>&lt;servlet&gt;
      &lt;servlet-name&gt;app&lt;/servlet-name&gt;
      &lt;servlet-class&gt;org.springframework.web.servlet.DispatcherServlet&lt;/servlet-class&gt;
      &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
  &lt;/servlet&gt;
  &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;app&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  </code></pre>
  
  <p>I have a <strong>app-servlet.xml</strong> file that scans the packages and defines a <code>InternalResourceViewResolver</code>:</p>
  
  <pre><code>&lt;context:component-scan base-package="com.whiuk.philip.web" /&gt;
  &lt;mvc:annotation-driven /&gt;
  &lt;bean id="viewResolver"
      class="org.springframework.web.servlet.view.InternalResourceViewResolver"&gt;
      &lt;property name="prefix" value="/WEB-INF/jsp/" /&gt;
      &lt;property name="suffix" value=".jsp" /&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>I have a <code>IndexController</code> that has a RequestMapping for index:</p>
  
  <pre><code> @Controller
   public class IndexController {
        @RequestMapping(value = "/index", method = RequestMethod.GET)
        public ModelAndView index() {
               return new ModelAndView();
        }
   }
  </code></pre>
  
  <p>Logs show this is registered:</p>
  
  <pre><code>org.springframework.web.servlet.handler.AbstractHandlerMethodMapping registerHandlerMethod
  INFO: Mapped "{[/index],methods=[GET],params=[],headers=[],consumes=[],produces=[],custom=[]}"
  onto public org.springframework.web.servlet.ModelAndView 
  com.whiuk.philip.web.controller.IndexController.index()
  </code></pre>
  
  <p>Finally I have a <strong>index.jsp</strong> file.</p>
  
  <p>Can someone please explain what the misconfiguration is that results in the error shown at the top and, if possible, provide a sentence or so on the purpose of DispatcherServlet, Resolvers and how they feed into Controllers.</p>