title: Java, Spring, Apache Tiles error : Could not resolve view with name 'index' in servlet with name 'dispatcher'
body: <p>I'm new to Tiles and Spring MVC (I looked through several similar issues but found no solution for 'my problem')</p>
  
  <p>controller:</p>
  
  <pre><code>@Controller
  public class IndexController {
  
      @RequestMapping("/index")
      public String index(){
          return "index";
      }
  }
  </code></pre>
  
  <p>My 'general.xml' containing the Tiles definitions:</p>
  
  <pre><code>&lt;tiles-definitions&gt;
  &lt;definition name="common" template="/WEB-INF/layout/classic.jsp"&gt;
      &lt;put-attribute name="footer" value="/WEB-INF/layout/footer.jsp" /&gt;
  &lt;/definition&gt;
  
  &lt;definition name="index" extends="common"&gt;
      &lt;put-attribute name="title" value="My First Application" /&gt;
      &lt;put-attribute name="body" value="/WEB-INF/jsp/index.jsp" /&gt;
  &lt;/definition&gt;
  </code></pre>
  
  <p></p>
  
  <p>exception:</p>
  
  <pre><code>javax.servlet.ServletException: Could not resolve view with name 'index' in servlet with name 'dispatcher'
  at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1208)
  at org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:1012)
  at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:959)
  at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:876)
  at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:961)
  at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:852)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:687)
  at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:837)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
  at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:738)
  at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:551)
  at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
  at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:586)
  at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:221)
  at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1111)
  at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:478)
  at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:183)
  at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1045)
  at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
  at org.eclipse.jetty.server.Dispatcher.forward(Dispatcher.java:261)
  at org.eclipse.jetty.server.Dispatcher.forward(Dispatcher.java:101)
  at org.eclipse.jetty.servlet.DefaultServlet.doGet(DefaultServlet.java:552)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:687)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
  at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:738)
  at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:551)
  at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
  at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:568)
  at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:221)
  at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1111)
  at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:478)
  at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:183)
  at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1045)
  at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
  at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:199)
  at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:109)
  at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
  at org.eclipse.jetty.server.Server.handle(Server.java:462)
  at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:279)
  at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:232)
  at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:534)
  at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:607)
  at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:536)
  at java.lang.Thread.run(Thread.java:744)
  </code></pre>
  
  <p>dispatcher-servlet.xml:</p>
  
  <pre><code>&lt;bean id="tilesConfigurer" class="org.springframework.web.servlet.view.tiles3.TilesConfigurer"&gt;
      &lt;property name="definitions"&gt;
          &lt;list&gt;
              &lt;value&gt;/WEB-INF/defs/general.xml&lt;/value&gt;
          &lt;/list&gt;
      &lt;/property&gt;
  &lt;/bean&gt;
  
  &lt;bean id="viewResolver" class="org.springframework.web.servlet.view.UrlBasedViewResolver"&gt;
      &lt;property name="viewClass" value="org.springframework.web.servlet.view.tiles3.TilesView"/&gt;  
  &lt;/bean&gt;
  </code></pre>
  
  <p>web.xml</p>
  
  <pre><code>  &lt;servlet&gt;
      &lt;servlet-name&gt;dispatcher&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;dispatcher&lt;/servlet-name&gt;
      &lt;url-pattern&gt;*.html&lt;/url-pattern&gt;
      &lt;url-pattern&gt;*.htm&lt;/url-pattern&gt;
      &lt;url-pattern&gt;*.json&lt;/url-pattern&gt;
      &lt;url-pattern&gt;*.xml&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  </code></pre>