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

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