Spring注解与Spring与Struts2整合

@Component

@Controller

@Service

@Repository

四大注解作用基本一样,只是表象在不同层面

@Resource

@Scope

Struts2与Spring整合:
1,添加Struts2的环境(jar包与配置文件)。
2,添加Spring的环境(jar包与配置文件)。
3,做整合:
    a, 配置ContextLoaderListener监听器,用于初始化Spring的ApplicationContext容器对象。
    b, 添加struts2-spring-plugin-2.1.8.1.jar。
4,使用时注意:
    a, 要在Spring中配置Action对象,并且一定要是scope="prototype"。
    b, 在struts.xml中配置action时,class属性写的是bean的名称。

原文地址:https://www.cnblogs.com/daxiong225/p/4708530.html