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>

 
posted @ 2017-02-16 17:08  sunbylm  阅读(304)  评论(0编辑  收藏  举报