SpringFrameWork 上下文工具类

//Servlet上下文
ServletContext application = event.getServletContext();
//Spring应用上下文
ApplicationContext applicationContext = WebApplicationContextUtils.getWebApplicationContext(application);

//获得bean

PropertyServ propertyServ = applicationContext.getBean(PropertyServ.class);

posted on 2016-11-21 12:03  winters86  阅读(131)  评论(0编辑  收藏  举报