Managing Tiles
Tiles is a templating system to create a common look and feel for a Web application.
Tiles are managed through creating, editing, and removing tile definitions, which describe tile
attributes and tile elements. Tile definitions are specified in the tiles-defs.xml
which is created when you enable tiles support.
With IntelliJ IDEA, you can edit the
tiles-defs.xml
file in the Struts Assistant tool window,
which provides two synchronized views: the
Structure Tree
and
the Properties Table.
Tiles are removed in the same way as other Struts elements.
Editing a tile includes editing its properties and handling its attributes: forwards, exceptions, and set properties.
To create a tile
- Enable tiles support.
- Open
tiles-defs.xml
. - To add a tile definition, add the
<definition>
element totiles-defs.xml
manually. - Switch to the Struts Assistant tool window, tab Tiles. A new Definition node appears in the Structure Tree.
- Specify the attributes of the new tile in the Properties Table.
Alternatively, right-click the tile in the tree and select or press F4. This will bring you to
tiles-defs.xml
where you can specify the tile's attributes manually. IntelliJ IDEA displays a template for specifying the mandatory attributes.
To remove a tile
To edit a tile
- Select it in the Structure Tree.
- To edit the attributes of the tile, make the necessary changes in the Properties Table.
- To manage the elements of a tile, use the Structure Tree and the Properties Table.
The elements are created, edited, and removed in the same way as common Struts elements.