读书人

获取目前Spring容器中的bean

发布时间: 2012-08-27 21:21:57 作者: rapoo

获取当前Spring容器中的bean

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

读书人网 >软件架构设计

热点推荐