java程序中取得spring管理的bean的方法怎么解决
java程序中取得spring管理的bean的方法怎么解决
日期:2016-10-18 13:19:20 人气:1
Spring 文件中将bean注入到想要获得该bean的类中。
或者:
ApplicationContext app=WebApplicationContextUtils.getWebApplicationContext(event
.getServletContext());
其中event 是ServletContextEvent 可以在listener中找到
