如何获得Spring容器里管理的Bean,。不论是Service层,还是实体Dao层

如何获得Spring容器里管理的Bean,。不论是Service层,还是实体Dao层,

下面的这个必须配置,否则必出错,空指针

下面的这个是代码

而获得bean代码如下:

serviceManagerImpl_fl=(ServiceManagerDao)MyApplicationContextUtil.getApplicationContext().getBean("serviceManagerImpl_fl");

 

posted on 2014-09-29 18:52  学无止境2023  阅读(957)  评论(0编辑  收藏  举报

导航