Name | Tiles Plugin | ||
---|---|---|---|
Author | N/A | ||
Homepage | N/A | ||
Version | N/A | ||
Compatibility | Bundled with Struts | ||
Publisher | Apache Software Foundation | State | Experimental - Depends on Tiles 2 beta |
License | Open Source (ASL2) | ||
Download | N/A |
Overview
The Tiles plugin
Excerpt |
---|
allows your Struts actions to return Tiles pages |
Info | ||
---|---|---|
| ||
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. |
Features
- Supports Tiles in Freemarker, JSP, and Velocity
Usage
The following steps must be taken in order to enable tiles support within your Struts2 application:
- Include the struts-tiles-plugin as a dependency in your web application. If you are using maven2, the dependency configuration will be similar to:
Code Block <dependency> <groupId>org.apache.struts</groupId> <artifactId>struts2-tiles-plugin</artifactId> <version>${version.tiles}</version> <scope>compile</scope> </dependency>
- Register the tiles listener. This listener will typically either be the standard tiles listener (org.apache.tiles.listener.TilesListener) or the Struts2 replacement (org.apache.struts2.tiles.TilesListener). The latter provides tighter integration with Struts features such as freemarker integration.
Code Block <listener> <listener-class>org.apache.struts2.tiles.StrutsTilesListener</listener-class> </listener>
- All package definitions which require tiles support must either extend the tiles-default package or must register the Tiles Result type definition.
Code Block <result-types> <result-type name="tiles" class="org.apache.struts2.views.tiles.TilesResult"/> </result-types>
- Configure your actions to utilize a tiles definition:
Code Block <action name="sample" class="org.apache.struts2.tiles.example.SampleAction" > <result name="success" type="tiles">tilesWorks</result> </action>
Example
This example shows a Tiles layout page using Struts tags:
Wiki Markup |
---|
{snippet:url=struts2/apps/showcase/src/main/webapp/tiles/layout.jsp|lang=xml} |
Settings
This plugin does not have any global settings.
Installation
Version | Bundled with Struts 2 |
---|---|
Homepage | |
Download |
The Tiles plugin
Excerpt |
---|
allows actions to return Tiles pages |
/WEB-INF/lib
directory. No other files need to be copied or created.