title: How to integrate properly Tiles 3 with Struts2 ?
body: <p>I'm trying to integrate Tiles 3 with Struts 2.</p>
  
  <p>I guess I've added all the necessary jar files in the lib but I get:</p>
  
  <blockquote>
    <p>java.lang.ClassNotFoundException: org.apache.struts2.tiles.StrutsTilesListener</p>
  </blockquote>
  
  <p><strong>web.xml</strong></p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;web-app id="WebApp_9" version="2.4" 
  xmlns="http://java.sun.com/xml/ns/j2ee" 
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
  xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee 
                      http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"&gt;
  &lt;listener&gt;
  &lt;listener-class&gt;org.apache.struts2.tiles.StrutsTilesListener&lt;/listener-class&gt;
  &lt;/listener&gt;    
  &lt;display-name&gt;My Application&lt;/display-name&gt;
  &lt;filter&gt;
      &lt;filter-name&gt;struts2&lt;/filter-name&gt;
      &lt;filter-class&gt;org.apache.struts2.dispatcher.ng.filter.StrutsExecuteFilter&lt;/filter-class&gt;
  &lt;/filter&gt;
  &lt;filter-mapping&gt;
      &lt;filter-name&gt;struts2&lt;/filter-name&gt;
      &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
  &lt;/filter-mapping&gt;
  &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.xml&lt;/param-value&gt;
  &lt;/context-param&gt;    
   &lt;welcome-file-list&gt;
    &lt;welcome-file&gt;index.jsp&lt;/welcome-file&gt;
        &lt;/welcome-file-list&gt;
     &lt;/web-app&gt;
  </code></pre>
  
  <p><strong>tile.xml</strong></p>
  
  <pre class="lang-xml prettyprint-override"><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="baseLayout" template="/baseLayout.jsp"&gt;
      &lt;put-attribute name="title" value="MyProject"&gt;&lt;/put-attribute&gt;
      &lt;put-attribute name="header" value=""&gt;&lt;/put-attribute&gt;
      &lt;put-attribute name="body" value=""&gt;&lt;/put-attribute&gt;
      &lt;put-attribute name="menu" value=""&gt;&lt;/put-attribute&gt;
      &lt;put-attribute name="footer" value=""&gt;&lt;/put-attribute&gt;
  &lt;/definition&gt;
  &lt;definition name="homePageLayout" template="/homePageLayout.jsp"&gt;
      &lt;put-attribute name="title" value="MyProject-HomePage"&gt;&lt;/put-attribute&gt;
      &lt;put-attribute name="header" value=""&gt;&lt;/put-attribute&gt;
      &lt;put-attribute name="leftMenu" value=""&gt;&lt;/put-attribute&gt;
      &lt;put-attribute name="body" value=""&gt;&lt;/put-attribute&gt;    
      &lt;put-attribute name="rightMenu" value=""&gt;&lt;/put-attribute&gt;   
  &lt;/definition&gt;
  &lt;/tiles-definitions&gt;   
  </code></pre>
  
  <p><strong>struts.xml</strong></p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;!DOCTYPE struts PUBLIC
     "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
     "http://struts.apache.org/dtds/struts-2.0.dtd"&gt;
  &lt;struts&gt;
  &lt;constant name="struts.enable.DynamicMethodInvocation" value="false"&gt;&lt;/constant&gt;
  &lt;constant name="struts.custom.i18n.resources" value="ApplicationResource"&gt;&lt;/constant&gt;
  &lt;package name="default" namespace="/" extends="struts-default"&gt; 
   &lt;result-types&gt;
      &lt;result-type name="tiles" class="org.apache.struts2.views.tiles.TilesResult"/&gt;
  &lt;/result-types&gt;     
    &lt;default-action-ref name="index"/&gt;
  
      &lt;action name="ShowLogin"&gt;&lt;result&gt;login.jsp&lt;/result&gt;&lt;/action&gt;
      &lt;action name="Login" class="com.myproject.action.Login"&gt;
          &lt;result name="success"&gt;login.jsp&lt;/result&gt;
      &lt;/action&gt;
  &lt;/package&gt;
  &lt;/struts&gt;
  </code></pre>