***手动测试,test包下显式加载beans.xml文件,测试OK***
struts2, Spring, Hibernate配置文件正常,JAR文件正确配置(struts2和spring集成的包已加入),WEB.XML文件正确配置。问题还能出现在哪呢????????求助!!!!!!!!!!!!!!!

解决方案 »

  1.   

    首先你web.xml里面要配置struts2的监听和spring的监听,因为程序启动只认web.xml。其余的东西都是通过它间接获得初始化的。你把各属性弄对,没问题的,包要导全
      

  2.   

    <filter>
       <filter-name>struts2</filter-name>
       <filter-class><!--使用spring来管理struts,需要在bean.xml中配置struts的action-->
       org.apache.struts2.dispatcher.FilterDispatcher
       </filter-class>
      </filter>
      <filter-mapping>
       <filter-name>struts2</filter-name>
       <url-pattern>/*</url-pattern>
      </filter-mapping>
      
       <context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>classpath:application-*.xml</param-value>
    </context-param>
      
        <listener>
    <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>  <servlet>
      

  3.   

    如果采用spring管理struts,需要配置struts.properties:
    struts.objectFactory=spring
      

  4.   

    是MyEclipse的问题....workapps和work下的编译文件和JAVA文件全部删除了一次,重新部署就OK.....唉, 害死人.也算长个经验吧