2016-12-16 33 views
0

初始化属性我有一个非簧bean类,看起来像这样:使用一个Spring bean的依赖

public class ReportFilterManager implements Serializable { 

private static final long serialVersionUID = 1L; 
@SpringBean 
private IControllersConfigService controllersConfigService; 

private List<String> fromGroupOfControllers = controllersConfigService.getAllGroupOfControllersNames(); 

我想用的Spring bean controllersConfigService的方法给init fromGroupOfControllers领域。什么是最好的方式来做到这一点?

回答

0

我想说最好的方法是通过controllersConfigService作为方法或构造参数。

您实例化ReportFilterManager的类应找到方法来以某种方式获得controllersConfigService

相关问题