OF: a smile Alone: Struts1.1 described later increased so that the struts Tiles package an extra option in processing the page and the code easier to reuse. Tiles are divided into the page in the TURBINE in the other item in Jakarta. Added the concept of Layout. It is actually divided into a few pieces. Usually, a page can probably be divided into the following: HEAD Page Head: Store public information: logo, etc. If it is a website that may be the top. Menu page menu: Place a use in use Menu, or connected to each page. FOOTER page: such as copyright information, etc. The topic content: Each page is relatively independent. If you press the above, we will write the body inside. Content, you can share reuse. If most page layouts are basically the same. We can even use a JSP file to call different BODY. 2: Tiles Configuration and Basic Profile Introduction Tiles has a configuration file: tiles Defs.xmltiles-Defs.xml defines the component of each page and forms.
Below I will explain the Tiles-Defs.xml file tiles-defs.xml as shown below -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ----------------- definition> < ! - Define Site.index.page, inherit Site.MainLayout -> definition> Putlist> definition> tiles-definiti ONS> Add: /Layouts/ClassicLayout.jsp ------------------------------ title> head>
td> < / TR>
td>
TD> TR>
td> tr> TABLE> body> html> Configure Tiles in Web.xml. The configuration is followed by the configuration of the struts action servlet as follows: Web.xml ----------------- action servlet-name> org.apache.struts.Action.ActionServlet servlet-class> definitions-config param-name> /web-inf/tiles-defs.xml param-value> init-param> definitions-debug param-name> 1 param-value> init-param> <
! - Tiles Servlet parameter Specify Digester debug level This value is passed to DigesterO: no debug information1: debug information2:. More debug information -> definitions-parser-details param- Name> 0 param-value> init-param> definitions-parser-validate param-name> true param-value> init-param> config param-name> /web-inf/struts-config.xml param-value> Init-param> Validate param-name> true param-value> init-param> debug param-name> 2 param-value> init-param> Detail param-name> 2 param -Value> init-param> 2 loading-on-st Artup> servlet> Three: Use Tile if TIELS-Defs.xml is configured, then you can use these definitions in the JSP file.