struts2中的action交由spring管理

有两种做法:

1、给项目添加Struts2-spring-plugin的jar包依赖:

添加struts2-spring-plugin的jar包,action配置的class改为spring的bean id值

2、struts2.xml中加入<constant name="struts.objectFactory" value="spring"></constant>

 
原文地址:https://www.cnblogs.com/man-li/p/6406613.html