首页 > 其他 > 详细

struts2 action 中autowired 不能注入

时间:2016-08-06 09:44:25      阅读:151      评论: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
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!