title: Spring MVC Tiles jsp page not load properly
body: <p>I'm working on a <strong>Spring MVC</strong> project using <strong>Tiles</strong>.When I run app,I get no error.But jsp page is not loaded properly like below</p>
  
  <p><img src="https://i.stack.imgur.com/uGkAI.png" alt="enter image description here"> </p>
  
  <p>When i look at this page's source,i can see layout.jsp and home.jsp codes are loaded.But as you see above,the page shows jsp tags only.</p>
  
  <p>Development Environment</p>
  
  <pre><code>-&gt; Spring MVC 3.2.8 Release
  -&gt; Apache Tiles 2.2.1 
      tiles-core-2.2.1.jar
      tiles-template-2.2.1.jar
      tiles-jsp-2.2.1.jar
      tiles-servlet-2.2.1.jar
      tiles-api-2.2.1.jar
      tiles-request-api-1.0.1.jar
  </code></pre>
  
  <p><strong>pom.xml</strong></p>
  
  <pre><code>&lt;!-- Servlet --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;javax.servlet&lt;/groupId&gt;
              &lt;artifactId&gt;servlet-api&lt;/artifactId&gt;
              &lt;version&gt;2.5&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;javax.servlet.jsp&lt;/groupId&gt;
              &lt;artifactId&gt;jsp-api&lt;/artifactId&gt;
              &lt;version&gt;2.1&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;javax.servlet&lt;/groupId&gt;
              &lt;artifactId&gt;jstl&lt;/artifactId&gt;
              &lt;version&gt;1.2&lt;/version&gt;
          &lt;/dependency&gt;
  </code></pre>
  
  <p><strong>web.xml</strong></p>
  
  <pre><code>&lt;web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://java.sun.com/xml/ns/javaee      http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"&gt;
   &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;appServlet&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  </code></pre>
  
  <p><strong>tiles.xml</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8" ?&gt;
  &lt;!DOCTYPE tiles-definitions PUBLIC "-//Apache Software Foundation//DTD Tiles Configuration 2.0//EN" "http://tiles.apache.org/dtds/tiles-config_2_0.dtd"&gt;      
  
  &lt;tiles-definitions&gt;
      &lt;definition name="base.definition"
          template="/WEB-INF/views/templates/template1/layout.jsp"&gt;
          &lt;put-attribute name="title" value=""/&gt;
          &lt;put-attribute name="header" value="/WEB-INF/views/templates/components/header.jsp"/&gt;
          &lt;put-attribute name="menu" value="menu"/&gt;
          &lt;put-attribute name="body" value=""/&gt;
          &lt;put-attribute name="footer" value="/WEB-INF/views/templates/components/footer.jsp"/&gt;
      &lt;/definition&gt;
      &lt;definition name="menu"
                 preparer="menuController"
                 template="/WEB-INF/views/templates/components/menu.jsp"&gt;
      &lt;/definition&gt;
      &lt;definition name="home" extends="base.definition"&gt;
      &lt;put-attribute name="title" value="Home"/&gt;
      &lt;put-attribute name="body" value="/WEB-INF/views/home.jsp"/&gt;
  &lt;/definition&gt;
  </code></pre>
  
  <p><strong>layout.jsp</strong></p>
  
  <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt;
  &lt;%@page language="java"  contentType="text/html; charset=ISO-8859-1"
      pageEncoding="ISO-8859-1"%&gt;
  &lt;%@taglib  uri="http://tiles.apache.org/tags-tiles" prefix="tiles"%&gt;
  &lt;%@taglib  uri="http://java.sun.com/jsp/jstl/core" prefix="c"%&gt;
  &lt;%@taglib  uri="http://www.springframework.org/tags" prefix="spring"%&gt;
  &lt;%@ taglib uri="http://www.springframework.org/tags/form" prefix="form" %&gt;
  
  &lt;html&gt;
  &lt;head&gt;
  
     &lt;meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/&gt;
     &lt;title&gt;&lt;tiles:getAsString name="title"/&gt;&lt;/title&gt; 
    &lt;link rel="stylesheet" type="text/css" href="&lt;c:url 
             value='/resources/css/style.css'/&gt;"/&gt; 
  
  &lt;/head&gt;
  &lt;body&gt;
     &lt;div id="layout"&gt;
      &lt;div id="header"&gt;
          &lt;tiles:insertAttribute name="header" /&gt;
      &lt;/div&gt;
      &lt;div id="content"&gt;
          &lt;div id="leftContent"&gt;
             &lt;tiles:insertAttribute name="menu" /&gt;
          &lt;/div&gt;
          &lt;div id="rightContent"&gt;
             &lt;tiles:insertAttribute name="body" /&gt;
          &lt;/div&gt;
      &lt;/div&gt;
      &lt;div id="footer"&gt;
          &lt;tiles:insertAttribute name="footer" /&gt;
      &lt;/div&gt;
     &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p><strong>home.jsp</strong></p>
  
  <pre><code>&lt;%@taglib  uri="http://java.sun.com/jsp/jstl/core" prefix="c" %&gt;
  &lt;%@ taglib uri="http://www.springframework.org/tags/form" prefix="form" %&gt;
  
  &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;c:if test="${!empty kodListe}"&gt;
          &lt;h3 &gt;En Son Eklenenler&lt;/h3&gt;
  
          &lt;c:forEach items="${kodListe}" var="kod"&gt;
              &lt;form:form action="kod" method="POST"&gt;
              &lt;table&gt;
              &lt;tr&gt; 
                 &lt;td&gt;
                    &lt;input type="hidden" name="kodId" value="${kod.kodId}" /&gt;
                    &lt;input value="${kod.kodBaslik}" type="submit"/&gt;
                 &lt;/td&gt;
              &lt;/tr&gt;
              &lt;tr&gt;
                  &lt;td&gt;
                       ${kod.kodEkleyenKullanici.kullaniciAd}
                  &lt;/td&gt;
                   &lt;td&gt;
                         ${kod.kodEklemeTarihi}
                   &lt;/td&gt;
              &lt;/tr&gt;
  
              &lt;/table&gt;
              &lt;/form:form&gt;
          &lt;/c:forEach&gt;
  </code></pre>
  
  <p><strong>servlet-context.xml</strong></p>
  
  <pre><code>&lt;bean id="viewResolver"
          class="org.springframework.web.servlet.view.UrlBasedViewResolver"&gt;
          &lt;property name="viewClass"
              value="org.springframework.web.servlet.view.tiles2.TilesView"&gt;
          &lt;/property&gt;
      &lt;/bean&gt;
      &lt;bean id="tilesConfigurer"
          class="org.springframework.web.servlet.view.tiles2.TilesConfigurer"&gt;
          &lt;property name="definitions"&gt;
              &lt;list&gt;
                  &lt;value&gt;/WEB-INF/tiles.xml&lt;/value&gt;
              &lt;/list&gt;
  
          &lt;/property&gt;
  </code></pre>
  
  <p>How to solve the problem?Thanks in advance</p>