apache tiles issue in spring MVC( view rendering path instead of content)
<p>I am working on my first spring MVC project with apache tiles. However, I am having an issue with what is being rendered to view.</p>

<p>Instead of contents from index.jsp (ie, Hello from spring MVC exclusive) to be rendered it renders the path (WEB-INF/jsp/index.jsp) and for footer it renders (WEB-INF/layouts/footer.jsp) instead of </p>

<p>© laxmon philip</p>

<p>Please see attached screenshot of my output.   <a href="https://i.stack.imgur.com/H7E79.png" rel="nofollow">localhost:8080 output screenshot</a></p>

<p>This is my first spring MVC with apache tiles. Please let me know what I am ding wrong here.</p>

<p>My tiles-definition as follows</p>

<p>general.xml</p>

<pre><code>    &lt;?xml version="1.0" encoding="ISO-8859-1" ?&gt;
&lt;!DOCTYPE tiles-definitions PUBLIC
   "-//Apache Software Foundation//DTD Tiles Configuration 3.0//EN"
   "http://tiles.apache.org/dtds/tiles-config_3_0.dtd"&gt;
&lt;tiles-definitions&gt;
&lt;definition name="common" template="WEB-INF/layouts/classic.jsp"&gt;
  &lt;put-attribute name="footer" value="WEB-INF/layouts/footer.jsp" /&gt;
&lt;/definition&gt;

  &lt;definition name="index" extends="common"&gt;
  &lt;put-attribute name="title" value="JAVA BLOG AGGREGATOR" /&gt;
  &lt;put-attribute name="body" value="WEB-INF/jsp/index.jsp" /&gt;
&lt;/definition&gt;
&lt;/tiles-definitions&gt;
</code></pre>

<p>classic.jsp template</p>

<pre><code>&lt;%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%&gt;
&lt;%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles" %&gt;
&lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt;
&lt;html&gt;
&lt;head&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"&gt;
&lt;title&gt;&lt;tiles:getAsString name="title"/&gt;&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;

&lt;tiles:insertAttribute name="body"/&gt;

&lt;br&gt;&lt;br&gt;
&lt;center&gt;
&lt;tiles:insertAttribute name="footer"/&gt;
&lt;/center&gt;

&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>footer.jsp template</p>

<pre><code>&lt;%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%&gt;

&amp;copy; laxmon philip
</code></pre>

<p>index.jsp page</p>

<pre><code> &lt;%@ page language="java" contentType="text/html; charset=UTF-8"
 pageEncoding="UTF-8"%&gt;
&lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt;
&lt;html&gt;
&lt;head&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"&gt;
&lt;/head&gt;

&lt;h2&gt;Hello World From Spring MVC&lt;/h2&gt;

&lt;/html&gt;
</code></pre>

<p>IndexController.java class</p>

<pre><code>package cn.laxi.jaxrs.controllers;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class IndexController {

@RequestMapping("/index")
    public String index(){
  return "index";
}
}
</code></pre>

<p>Dispatcher-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"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans     http://www.springframework.org/schema/beans/spring-beans.xsd
    http://www.springframework.org/schema/context   http://www.springframework.org/schema/context/spring-context-4.3.xsd"&gt;

&lt;context:component-scan base-package="cz.laxi.org.controllers"&gt;&lt;/context:component-scan&gt;

&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;
&lt;/beans&gt;
</code></pre>

<p>pom.xml</p>

<pre><code>&lt;properties&gt;
  &lt;org.springframework.version&gt;4.3.3.RELEASE&lt;/org.springframework.version&gt;
   &lt;apache.tiles&gt;3.0.7&lt;/apache.tiles&gt;
&lt;/properties&gt;

&lt;dependencies&gt;
&lt;dependency&gt;
    &lt;groupId&gt;org.slf4j&lt;/groupId&gt;
    &lt;artifactId&gt;log4j-over-slf4j&lt;/artifactId&gt;
    &lt;version&gt;1.7.6&lt;/version&gt;
&lt;/dependency&gt;
&lt;dependency&gt;
    &lt;groupId&gt;org.apache.tiles&lt;/groupId&gt;
    &lt;artifactId&gt;tiles-core&lt;/artifactId&gt;
    &lt;version&gt;${apache.tiles}&lt;/version&gt;
&lt;/dependency&gt;

&lt;dependency&gt;
    &lt;groupId&gt;org.apache.tiles&lt;/groupId&gt;
    &lt;artifactId&gt;tiles-jsp&lt;/artifactId&gt;
    &lt;version&gt;${apache.tiles}&lt;/version&gt;
&lt;/dependency&gt;
</code></pre>

<p>web.xml</p>

<p>http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" version="3.1">
     javabloggers
     
     index.html
     index.htm
        index.jsp
     default.html
        default.htm
     default.jsp
    </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;
&lt;/web-app&gt;
</code></pre>

<p>Why is the path getting delivered in view( for body and footer) instead of content in index.jsp?</p>