struts2.18与spring整合怎么老是出unable load .....的异常啊,我都调了好几天了,还是这个问题,这是怎么会事啊,请各位高手指点一下,在此,先谢谢了

解决方案 »

  1.   

    所有异常啊
    load class?load xml?
    检查你的jar是否都引入叻?xml配置都对吗?
    网上很多例子的,对照着一步步来嘛。
      

  2.   

    你可以先整合struts2.18,写一个测试的action进行试验,将程序调试正常后,再把struts的spring插件包加进去并加入spring框架,添加spring的监听,这样肯定能找到原因。
      

  3.   

    jar包导入了没有  冲突包删了没有没代码 看不出来
      

  4.   

    先确保所有jar包导入正确,再
    在web.xml文件中配置spring的监听器
    <listener>
        <listener-class>
    org.springframework.web.context.ContextLoaderListener
        </listener-class>
    </listener>
    再确保配置了struts2的过滤器
    <filter>
       <filter-name>struts2</filter-name>
       <filter-class>
          org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
       </filter-class>
    </filter>
    <filter-mapping>
      <filter-name>struts2</filter-name>
      <url-pattern>/*</url-pattern>
    </filter-mapping>
      

  5.   

    1>.jar包引用:
      struts2-spring-plugin.jar
      spring.jar
      commons-logging.jar2>.属性配置:
      struts.objectFactory = spring
      struts.objectFactory.spring.autowire = name3>.web.xml配置:
        <listener>
    <listener-class>
    org.springframework.web.context.ContextLoaderListener
    </listener-class>
        </listener>4>.applicationContext.xml配置:
         <beans default-autowire="byName"></beans>5>.struts.xml配置:
         <action name="请求" class="Spring配置文件中定义id名字"></action>注:jar包版本号没有加,根据struts2版本决定。