首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 软件管理 > 软件架构设计 >

获取目前Spring容器中的bean

2012-08-27 
获取当前Spring容器中的beanWebApplicationContext applicationContext WebApplicationContextUtils.get

获取当前Spring容器中的bean

WebApplicationContext applicationContext = WebApplicationContextUtils.getWebApplicationContext(request.getSession().getServletContext());PersonService personService = (PersonService)applicationContext.getBean("personService");

热点排行