[200分]Struts中如何使多个配置文件struts-config.xml并给个能运行的例子!!![急等]
急等!
------解决方案--------------------下面是一个itfuture java培训中心的教程,有两种关于struts多配置的详细讲述和例子
http://www.itfuture.org/show.asp?ID=307
记着加分!!
------解决方案--------------------在web.xml里面配置如下:
以下是我的例子
<init-param>
<param-name> config </param-name>
<param-value> /WEB-INF/struts-config.xml, /WEB-INF/struts-config-basicdata.xml , /WEB-INF/struts-config-stock.xml, /WEB-INF/struts-config-sale.xml , /WEB-INF/struts-config-salary.xml , /WEB-INF/struts-config-report.xml, /WEB-INF/struts-config-product.xml , /WEB-INF/struts-config-price.xml , /WEB-INF/struts-config-collection.xml, /WEB-INF/struts-config-check.xml, /WEB-INF/struts-config-bill.xml, /WEB-INF/struts-config-backup.xml </param-value>
</init-param>
------解决方案-------------------- <servlet>
<servlet-name> action </servlet-name>
<servlet-class> org.apache.struts.action.ActionServlet </servlet-class>
<init-param>
<param-name> definitions-debug </param-name>
<param-value> 0 </param-value>
</init-param>
<init-param>
<param-name> definitions-parser-details </param-name>
<param-value> 0 </param-value>
</init-param>
<init-param>
<param-name> definitions-parser-validate </param-name>
<param-value> false </param-value>
</init-param>
<init-param>
<param-name> config </param-name>
<param-value> /WEB-INF/struts-config.xml, /WEB-INF/struts-config-basicdata.xml , /WEB-INF/struts-config-stock.xml, /WEB-INF/struts-config-sale.xml , /WEB-INF/struts-config-salary.xml , /WEB-INF/struts-config-report.xml, /WEB-INF/struts-config-product.xml , /WEB-INF/struts-config-price.xml , /WEB-INF/struts-config-collection.xml, /WEB-INF/struts-config-check.xml, /WEB-INF/struts-config-bill.xml, /WEB-INF/struts-config-backup.xml </param-value>
</init-param>
------解决方案--------------------www203(水户洋平) ( )
这个的就行了,也可以将
<param-name> config </param-name>
<param-value> /WEB-INF/struts-config.xml, /WEB-INF/struts-config-basicdata.xml , /WEB-INF/struts-config-stock.xml, /WEB-INF/struts-config-sale.xml , /WEB-INF/struts-config-salary.xml , /WEB-INF/struts-config-report.xml, /WEB-INF/struts-config-product.xml , /WEB-INF/struts-config-price.xml , /WEB-INF/struts-config-collection.xml, /WEB-INF/struts-config-check.xml, /WEB-INF/struts-config-bill.xml, /WEB-INF/struts-config-backup.xml </param-value>
分着来写,多个 <param-name> config </param-name> ,层次还清晰点