码迷,mamicode.com
首页 > 其他好文 > 详细

struts2 action 中autowired 不能注入

时间:2016-08-06 09:45:44      阅读:300      评论:0      收藏:0      [点我收藏+]

标签:

一、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

struts2 action 中autowired 不能注入

标签:

原文地址:http://www.cnblogs.com/zno2/p/4818498.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!