For the layout management of the page, Tiles is well done so that we think is very smooth during the development process, especially in the process of developing the Struts development project, often with Tiels to assist in the development, effect. If you want to see the detailed documentation of Tiles, visit http://www.lifl.fr/~dumoulin/tiles/ I want to say your experience from the way: often in one project, most of the page The layout is the same, and this is not much if we pay the same style page as a class. (Different projects have different classifications, whether to see if the page style planning is highly efficient) Suppose we propose a type of page (such as product management) style, the layout is as follows: then we can define this in tiles-defs.xml A total type, as follows: Tiles-Defs.xml is placed in / YourWebApp / Web-INF /
Xml Version = "1.0" encoding = "ISO-8859-1"?>
DOCTYPE TILES-Definitions PUBLIC
"- // Apache Software Foundation //
DTD TILES Configuration1.1 // En "
"http://jakarta.apache.org/struts
/DTDS/TILES-CONFIG_1_1.DTD ">
Path = "/ homepage.jsp"> definition> ...... ...... definition> ...... tiles-definitions> The above defines a layout type. It is assumed to be named a layout. Here we want to list the layout method of this type of style page to add a product page. In the end we have to care, addproducts.jsp this page, but how do we use a layout? What about the layout? As follows: ... connected to Tiles-Defs.xml ... Path = "/ homepage.jsp"> definition>
Subclass 1: Add goods "One-> Extends = "mainlayout">
Other reservations -> definition> Extends = "mainlayout"> definition> .......... The above is only illustrated by a layout type, and other layout types (such as layout B, layout C .....) are expanded in communication with communication, there is nothing difficult. Below, the following is a configuration in Struts-Config.xml, in Struts1.1 Tiles is the use of Struts's extension mechanism to complete the load, the code is simple as follows: //struts-config.xml ...... Value = "/ Web-inf / tiles-defs.xml" /> plug-in> If you have multiple TILES configuration files, then "," is separated. The following is to take a write mapping after using Tiles, as we want to add a request to add a product, in the Add Page, you should first carry out the loading of the product type: addProductAction.do -> ProductAction -> addproducts.jsp ProductAction Complete the product type Collection Returns Client //Struts-config.xml.......... TYPE = "com. ***. ProductAction"> action> .......... Ok, the above processes use TILES for a brief description, and the specific Tiles documents are given to the connection given above. The Struts release package also has a TILSE documentation and example.