|
Struts s Tiles使用入门(2) <putList name="list" > <add value="site.menu.links" /> <add value="site.menu.documentation" /> </putList> </definition> </tiles-definitions> 附:/layouts/classicLayout.jsp -------------------------------- <html> <head> <title><tiles:getAsString name="title"/> </title> </head> <body bgcolor="#ffffff" text="#000000" link="#023264" alink="#023264" vlink="#023264"> <table border="0" width="100%" cellspacing="5"> <tr> <td colspan="2"><tiles:insert attribute="header" /></td> </tr> <tr> <td width="140" valign="top"> <tiles:insert attribute='menu'/> </td> <td valign="top" align="left"> <tiles:insert attribute='body' /> </td> </tr> <tr> <td colspan="2"> <tiles:insert attribute="footer" /> </td> </tr> </table> </body> </html> 在web.XML里面配置tiles,配置完后对应struts action servlet的配置如下: web.XML ----------------- <!-- Action Servlet Configuration --> <servlet> <servlet-name>action</servlet-name> <!-- Specify servlet class to use: - Struts1.0.x: ActionComponentServlet - Struts1.1: ActionServlet - no Struts: TilesServlet --> <servlet-class>org.apache.struts.action.ActionServlet</servlet-class> <!-- Tiles Servlet parameter Specify configuration file names. There can be several comma separated file names --> <init-param> <param-name>definitions-config</param-name> <param-value>/WEB-INF/tiles-defs.XML</param-value>
|