title: Basic Spring MVC config: PageNotFound using InternalResourceViewResolver
body: <p>I'm trying to get a first Spring 3 MVC setup running.</p>
  
  <p>My app is running on tomcat, with in the server context of "grapevine"</p>
  
  <p>For the purposes of testing, I'm trying to get requests from <code>http://localhost:8080/grapevine/test</code> to render the contents of <code>WEB-INF/jsp/noSuchInvitation.jsp</code></p>
  
  <p>When I try this, I'm getting a <code>404</code>, and the logs suggest that my jsp isn't present:</p>
  
  <pre><code>WARN  org.springframework.web.servlet.PageNotFound  - No mapping found for HTTP request with URI [/grapevine/WEB-INF/jsp/noSuchInvitation.jsp] in DispatcherServlet with name 'grapevine'
  </code></pre>
  
  <p>I must have mis-configured this somewhere, but I can't see what I've done wrong.</p>
  
  <p>Here's all the relevant snippets.</p>
  
  <p><strong>Web.xml:</strong></p>
  
  <pre><code>&lt;servlet&gt;
      &lt;servlet-name&gt;grapevine&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;grapevine&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  </code></pre>
  
  <p><strong>From my context:</strong></p>
  
  <pre><code>&lt;mvc:annotation-driven /&gt;
  &lt;bean 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><strong>Controller:</strong></p>
  
  <pre><code>@Controller
  public class ParticipantInvitationController {
  
  @RequestMapping("/test")
  public ModelAndView test()
  {
      return new ModelAndView("noSuchInvitation");
  }
  </code></pre>
  
  <p><strong>Log:</strong></p>
  
  <pre><code>DEBUG org.springframework.web.servlet.DispatcherServlet  - Rendering view [org.springframework.web.servlet.view.JstlView: name 'noSuchInvitation'; URL [/WEB-INF/jsp/noSuchInvitation.jsp]] in DispatcherServlet with name 'grapevine'
  DEBUG org.springframework.web.servlet.view.JstlView  - Forwarding to resource [/WEB-INF/jsp/noSuchInvitation.jsp] in InternalResourceView 'noSuchInvitation'
  DEBUG org.springframework.web.servlet.DispatcherServlet  - DispatcherServlet with name 'grapevine' processing GET request for [/grapevine/WEB-INF/jsp/noSuchInvitation.jsp]
  WARN  org.springframework.web.servlet.PageNotFound  - No mapping found for HTTP request with URI [/grapevine/WEB-INF/jsp/noSuchInvitation.jsp] in DispatcherServlet with name 'grapevine'
  DEBUG org.springframework.security.web.context.HttpSessionSecurityContextRepository  - SecurityContext contents are anonymous - context will not be stored in HttpSession. 
  DEBUG org.springframework.web.servlet.DispatcherServlet  - Successfully completed request
  </code></pre>