zno2

struts2 action 中autowired 不能注入

一、pom.xml

     <dependency>
            <groupId>org.apache.struts</groupId>
            <artifactId>struts2-spring-plugin</artifactId>
            <version>2.3.15.3</version>
        </dependency>

二、struts.xml

   <!-- struts.xml 使用spring工厂 -->
    <constant name="struts.objectFactory" value="spring" />

 

org.apache.struts2.spring.StrutsSpringObjectFactory

 

action 应该托管给spring

posted on 2016-08-06 08:15  zno2  阅读(355)  评论(0编辑  收藏  举报

导航