在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> </init-param>
<!-- Tiles Servlet parameter Specify Tiles debug level. O : no debug information 1 : debug information 2 : more debug information --> <init-param> <param-name>definitions-debug</param-name> <param-value>1</param-value> </init-param>
<!-- Tiles Servlet parameter Specify Digester debug level. This value is passed to Digester O : no debug information 1 : debug information 2 : more debug information --> <init-param> <param-name>definitions-parser-details</param-name> <param-value>0</param-value> </init-param>
<!-- Tiles Servlet parameter Specify if xml parser should validate the Tiles configuration file. true : validate. DTD should be specified in file header. false : no validation --> <init-param> <param-name>definitions-parser-validate</param-name> <param-value>true</param-value> </init-param>
<!-- Struts configuration, if Struts is used --> <init-param> <param-name>config</param-name> <param-value>/WEB-INF/struts-config.xml</param-value> </init-param> <init-param> <param-name>validate</param-name> <param-value>true</param-value> </init-param> <init-param> <param-name>debug</param-name> <param-value>2</param-value> </init-param> <init-param> <param-name>detail</param-name> <param-value>2</param-value> </init-param>