1、定义SpringUtil
import org.springframework.beans.BeansException;}
2、spring的配置文件加入
<bean id="applicationContext" class="com.lefu.pushCore.other.SpringUtil"/>
3、通过如下方法便能获取到所有由spring管理的对象了:
PushController pushController = (PushController) SpringUtil.getApplicationContext().getBean("pushController");原文地址:http://blog.csdn.net/sprita1/article/details/44700325