依赖注入方式

2017/02/12 iteye

DI三种注入方式:  

构造函数注入  

Set方法注入

Spring框架中主要采用的方法  

接口注入      

比如Struts2 中的action是POJO,如果需要访问http request, response, session, application, servlet context,需要实现相应的Aware接口。

Search

    Table of Contents