我用的是ssh框架,在web.xml中添加了
 <filter>
        <filter-name>struts2</filter-name>
        <filter-class>
            org.apache.struts2.dispatcher.FilterDispatcher
        </filter-class>
        <init-param>
         <param-name>config</param-name>
         <param-value>struts-cn.xml</param-value>
        </init-param>

    </filter>
后,会出现Cannot locate the chosen ObjectFactory implementation: spring异常,请问怎么把多个struts.xml文件加进去,还有用includ是怎么加的

解决方案 »

  1.   

    <include file="/struts/struts-base.xml" />
      

  2.   

    不用加在web.xml中。在struts.xml中进行包含即可。参照:<!DOCTYPE struts PUBLIC
        "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
        "http://struts.apache.org/dtds/struts-2.0.dtd">
    <struts> <!-- ベース -->
    <package name="base" extends="struts-default" abstract="true"> <!-- 黙認アクション -->
    <default-action-ref name="DefaultAction"></default-action-ref> <action name="DefaultAction">
    <result>/WEB-INF/jsp/comm/ER0001.jsp</result>
    </action> </package> <!-- 導入 -->
    <include file="config/struts/admin/admin.xml"></include>
    <include file="config/struts/applic/applic.xml"></include></struts>