title: Spring MVC - jsp not rendering
body: <p>I'm just starting with Spring MVC trying to create a new project, and came accross an issue for which no manual or tutorial seems to help...</p>
  
  <p>I have set up a simple application with no logic, just trying to get Spring configured properly. The controller just returns the name of a view to be displayed, but the view resolver is not rendering the jsp, and returning a 404 error....</p>
  
  <p>Any help is greatly appreciated.</p>
  
  <p>My web.xml is:</p>
  
  <pre><code>&lt;web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee 
           http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"&gt;
    &lt;servlet&gt;
      &lt;servlet-name&gt;openstats&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;openstats&lt;/servlet-name&gt;
      &lt;url-pattern&gt;*.do&lt;/url-pattern&gt;
    &lt;/servlet-mapping&gt;
  
    &lt;display-name&gt;OpenStats API Server&lt;/display-name&gt;
  &lt;/web-app&gt;
  </code></pre>
  
  <p>An my openstats-servlet.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;beans xmlns="http://www.springframework.org/schema/beans"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
         xsi:schemaLocation="http://www.springframework.org/schema/beans
             http://www.springframework.org/schema/beans/spring-beans-2.5.xsd"&gt;
  
      &lt;context:component-scan base-package="org.openstats.api.controller"/&gt;
  
      &lt;!-- Enable to request mappings PER METHOD --&gt;
      &lt;bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter"/&gt;
  
      &lt;!-- Enable annotated POJO @Controller --&gt;
      &lt;bean class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping"/&gt;
  
      &lt;!-- Define the view resolver to use jsp files within the jsp folder --&gt;
      &lt;bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver"&gt;
          &lt;property name="viewClass"&gt;&lt;value&gt;org.springframework.web.servlet.view.JstlView&lt;/value&gt;&lt;/property&gt;
          &lt;property name="prefix"&gt;&lt;value&gt;/jsp/&lt;/value&gt;&lt;/property&gt;
          &lt;property name="suffix"&gt;&lt;value&gt;.jsp&lt;/value&gt;&lt;/property&gt;
      &lt;/bean&gt;
  &lt;/beans&gt;
  </code></pre>
  
  <p>The controller itself has no logic whatsoever, it's simply:</p>
  
  <pre><code>@Controller
  public class ProductController {
  
      @RequestMapping(value = "/products.do", method = RequestMethod.GET)
      public ModelAndView listProducts(HttpServletRequest request) {
  
          ModelAndView model = new ModelAndView("index");
          return model;
      }
  }
  </code></pre>
  
  <p>The controller is reached, the issue is when attempting to render...</p>
  
  <p>I set up log4j in debug, and this is part of what I get:</p>
  
  <blockquote>
    <p>02:08:19,702 DEBUG
    DispatcherServlet:1094 - Testing handler adapter
    [org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter@397b6074]
    02:08:19,803 DEBUG
    HandlerMethodInvoker:134 - Invoking
    request handler method: public org.springframework.web.servlet.ModelAndView
    org.openstats.api.controller.ProductController.listProducts(javax.servlet.http.HttpServletRequest)
    02:08:19,833 DEBUG
    DefaultListableBeanFactory:1367 -
    Invoking afterPropertiesSet() on bean
    with name 'index' 02:08:19,876 DEBUG
    InternalResourceViewResolver:81 -
    Cached view [index] 02:08:19,877 DEBUG
    DispatcherServlet:1181 - Rendering
    view
    [org.springframework.web.servlet.view.JstlView:
    name 'index'; URL [/jsp/index.jsp]] in
    DispatcherServlet with name
    'openstats' 02:08:19,877 DEBUG
    JstlView:240 - Rendering view with
    name 'index' with model {} and static
    attributes {} 02:08:19,923 DEBUG
    JstlView:234 - Forwarding to resource
    [/jsp/index.jsp] in
    InternalResourceView 'index'
    02:08:19,926 DEBUG
    DispatcherServlet:955 -
    DispatcherServlet with name
    'openstats' determining Last-Modified
    value for [/api-server/jsp/index.jsp]
    02:08:19,927 DEBUG
    DispatcherServlet:1054 - Testing
    handler map
    [org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping@440c4cee]
    in DispatcherServlet with name
    'openstats' 02:08:19,928 DEBUG
    DefaultAnnotationHandlerMapping:179 -
    No handler mapping found for
    [/jsp/index.jsp] 02:08:19,929 DEBUG
    DispatcherServlet:962 - No handler
    found in getLastModified 02:08:19,937
    DEBUG DispatcherServlet:781 -
    DispatcherServlet with name
    'openstats' processing request for
    [/api-server/jsp/index.jsp]
    02:08:19,938 DEBUG
    DispatcherServlet:843 - Bound request
    context to thread: GET
    /api-server/products.do HTTP/1.1</p>
  </blockquote>
  
  <p>My jsp folder is right within "webapp" and the index.jsp file exists.</p>
  
  <p>Thanks in advance.</p>