Tiles is a templating framework designed to easily allow the creation of web application pages with a consistent look and feel. It can be used for both page decorating and componentization. |
The following steps must be taken in order to enable tiles support within your Struts2 Portlet application:
<dependency> <groupId>org.apache.struts</groupId> <artifactId>struts2-portlet-tiles-plugin</artifactId> <version>${struts2.version}</version> </dependency> |
<result-types> <result-type name="tiles" class="org.apache.struts2.views.tiles.PortletTilesResult"/> </result-types> |
<action name="tilesDirect" class="org.apache.struts2.portlet.dispatcher.DirectRenderFromEventAction"> <result type="tiles" name="success">$\{location\}</result> </action> |
<action name="sample" class="org.apache.struts2.tiles.example.SamplePortletAction" > <result name="success" type="tiles">tilesWorks</result> </action> |
This plugin can be installed by copying the plugin jar into your application's /WEB-INF/lib
directory. No other files need to be copied or created.