title: JSP Tiles without Struts with Maven
body: <p>You can see in screenshots exception and the web.xml file to config tiles-defs.xml.</p>
  
  <p>But i couldn't understand what is the problem about tiles? Is it wrong web.xml tiles configuration? Thanks for your attentions.</p>
  
  <p>web.xml</p>
  
  <pre><code>&lt;context-param&gt;
      &lt;param-name&gt;
          org.apache.tiles.impl.BasicTilesContainer.DEFINITIONS_CONFIG&lt;/param-name&gt;
      &lt;param-value&gt;/WEB-INF/tiles-defs.xml&lt;/param-value&gt;
  &lt;/context-param&gt;
  </code></pre>
  
  <p>tiles-defs.xml</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="homepage" template="/view/layouts/home.jsp"&gt;
     &lt;put-attribute name="cssPaths" value="/view/tiles/common/cssPaths.jsp"/&gt;
     &lt;put-attribute name="metas" value="/view/tiles/common/metas.jsp"/&gt;
     &lt;put-attribute name="header" value="/view/tiles/common/header.jsp"/&gt;
     &lt;put-attribute name="footer" value="/view/tiles/common/footer.jsp"/&gt;
     &lt;put-attribute name="sliders" value="/view/tiles/common/sliders.jsp"/&gt;
     &lt;put-attribute name="featureditems" value="/view/tiles/common/featureditems.jsp"/&gt;
     &lt;put-attribute name="scripts" value="/view/tiles/common/scripts.jsp"/&gt;
     &lt;put-attribute name="brands" value="/view/tiles/common/brands.jsp"/&gt;
    &lt;/definition&gt;
   &lt;/tiles-definitions&gt;
  </code></pre>
  
  <p>pom.xml </p>
  
  <pre><code>     &lt;project xmlns="http://maven.apache.org/POM/4.0.0"    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"&gt;
               &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
               &lt;groupId&gt;com&lt;/groupId&gt;
              &lt;artifactId&gt;ecommerce&lt;/artifactId&gt;
             &lt;packaging&gt;war&lt;/packaging&gt;
              &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
             &lt;name&gt;ecommerce Maven Webapp&lt;/name&gt;
              &lt;url&gt;http://maven.apache.org&lt;/url&gt;
         &lt;dependencies&gt;
          &lt;dependency&gt;
            &lt;groupId&gt;junit&lt;/groupId&gt;
             &lt;artifactId&gt;junit&lt;/artifactId&gt;
             &lt;version&gt;3.8.1&lt;/version&gt;
            &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&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;scope&gt;provided&lt;/scope&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;scope&gt;provided&lt;/scope&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;scope&gt;provided&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;taglibs&lt;/groupId&gt;
        &lt;artifactId&gt;standard&lt;/artifactId&gt;
        &lt;version&gt;1.1.2&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;mysql&lt;/groupId&gt;
          &lt;artifactId&gt;mysql-connector-java&lt;/artifactId&gt;
          &lt;version&gt;5.1.24&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.tiles&lt;/groupId&gt;
          &lt;artifactId&gt;tiles-extras&lt;/artifactId&gt;
          &lt;version&gt;3.0.1&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.tiles&lt;/groupId&gt;
          &lt;artifactId&gt;tiles-api&lt;/artifactId&gt;
          &lt;version&gt;3.0.1&lt;/version&gt;
      &lt;/dependency&gt;    
    &lt;/dependencies&gt;
    &lt;build&gt;
      &lt;finalName&gt;ecommerce&lt;/finalName&gt;
    &lt;/build&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>Exception</p>
  
  <pre><code>HTTP Status 500 -
  
  type Exception report
  
  message
  
  description The server encountered an internal error () that prevented it from fulfilling this request.
  
  exception
  
  org.apache.jasper.JasperException: An exception occurred processing JSP page /index.jsp at line 14
  
  11: &lt;title&gt;Urunler&lt;/title&gt;
  12: &lt;/head&gt;
  13: &lt;body&gt;
  14:     &lt;tiles:insertDefinition name="homepage"/&gt;
  15: &lt;/body&gt;
  16: &lt;/html&gt;
  
  
  Stacktrace:
      org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)
      org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:419)
      org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
      org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
  root cause
  
  java.lang.NullPointerException
      org.apache.tiles.access.TilesAccess.getContainer(TilesAccess.java:124)
      org.apache.tiles.access.TilesAccess.getContainer(TilesAccess.java:107)
      org.apache.tiles.access.TilesAccess.getCurrentContainer(TilesAccess.java:174)
      org.apache.tiles.template.InsertDefinitionModel.execute(InsertDefinitionModel.java:95)
      org.apache.tiles.jsp.taglib.InsertDefinitionTag.doTag(InsertDefinitionTag.java:254)
      org.apache.jsp.index_jsp._jspx_meth_tiles_005finsertDefinition_005f0(index_jsp.java:93)
      org.apache.jsp.index_jsp._jspService(index_jsp.java:66)
      org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
      org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
      org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
      org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
  note The full stack trace of the root cause is available in the Apache Tomcat/6.0.29 logs.
  
  Apache Tomcat/6.0.29
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/IHwXh.png" alt="exception">
  <img src="https://i.stack.imgur.com/epRmY.png" alt="enter image description here"></p>