1. 程式人生 > >配置多個struts-config檔案

配置多個struts-config檔案

在web.xml中配置
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>
org.apache.struts.action.ActionServlet
</servlet-class>
<init-param>
<param-name>application</param-name>
<param-value>application</param-value>
</init-param>
<init-param>
<param-name>config</param-name>
<param-value>
/WEB-INF/struts-config-comm.xml
,/WEB-INF/struts-config-base.xml
,/WEB-INF/struts-config-hr.xml
,/WEB-INF/struts-config-oa.xml
,/WEB-INF/struts-config-sale.xml
,/WEB-INF/struts-config-train.xml
,/WEB-INF/struts-config-statistic.xml
,/WEB-INF/struts-config-fn.xml
,/WEB-INF/struts-config-talent.xml
,/WEB-INF/struts-config-depot.xml
</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>
<load-on-startup>2</load-on-startup>
</servlet>

<!-- Standard Action Servlet Mapping -->
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>