title: apache tiles 2 JSPException including path
body: <p>I create a java web application with using Hibernate framework. 
  In WEB-INF, I created a new file: tiles-defs.xml, the below is the content in it:</p>
  
  <pre><code>&lt;?xml version='1.0' encoding='UTF-8' ?&gt; 
  &lt;!DOCTYPE tiles-definitions PUBLIC
     "-//Apache Software Foundation//DTD Tiles Configuration 2.1//EN"
     "http://tiles.apache.org/dtds/tiles-config_2_1.dtd"&gt;
  &lt;tiles-definitions&gt;
      &lt;definition name="Page" template="/share/layout.jsp"&gt;
           &lt;put-attribute name="title" value="Page" /&gt;
           &lt;put-attribute name="header" value="/share/header.jsp" /&gt;  
      &lt;/definition&gt;
      &lt;definition name="Index" extends="Page"&gt;
           &lt;put-attribute name="title" value="Vnmart" /&gt;
           &lt;put-attribute name="main" value="/home/IndexContent.jsp"/&gt;
      &lt;/definition&gt;    
  &lt;/tiles-definitions&gt;
  </code></pre>
  
  <p>And in web.xml, I added some rows:</p>
  
  <pre><code>&lt;context-param&gt;
      &lt;param-name&gt;
          org.apache.tiles.definition.DefinitionsFactory.DEFINITIONS_CONFIG
      &lt;/param-name&gt;
      &lt;param-value&gt;
          /WEB-INF/tiles-defs.xml
      &lt;/param-value&gt;
  &lt;/context-param&gt;
  &lt;listener&gt;
      &lt;listener-class&gt;org.apache.tiles.web.startup.TilesListener&lt;/listener-class&gt;
  &lt;/listener&gt;
  </code></pre>
  
  <p>In web pages folder, I created home folder to contain 2 jsp files: Index.jsp and IndexContent.jsp.
  Index.jsp:</p>
  
  <pre><code>&lt;%@taglib prefix="tiles" uri="http://tiles.apache.org/tags-tiles" %&gt;
  &lt;tiles:insertDefinition name="Index"/&gt;
  </code></pre>
  
  <p>And IndexContent.jsp:</p>
  
  <pre><code>&lt;div&gt;Home&lt;/div&gt;
  </code></pre>
  
  <p>After that, I created a controller package, and add new Home servlet:</p>
  
  <pre><code>String view = "home/Index.jsp";
  RequestDispatcher rd = request.getRequestDispatcher(view);
  rd.forward(request, response);
  </code></pre>
  
  <p>But when I ran, apache said: 'HTTP Status 404 - /Project2/' (Project2 is name of project). And then, I checked in Apache Tomcat Log, I found an error: </p>
  
  <blockquote>
    <p>'SEVERE: Servlet.service() for servlet [Home] in context with path
    [/Project2] threw exception
    [org.apache.tiles.impl.CannotRenderException: JSPException including
    path '/layouts/layoutfront.jsp'.] with root cause
    javax.servlet.ServletException: File
    &quot;/home/IndexContent.jsp&quot; not found'</p>
  </blockquote>
  
  <p>I have no ideas about this, I followed some tutorial how to working with tiles, but I'm still get stuck.</p>