ServletContext servletContext = this.getServletContext();
WebApplicationContext ctx = WebApplicationContextUtils.getWebApplicationContext(servletContext);
WebApplicationContext ctx = WebApplicationContextUtils.getWebApplicationContext(servletContext);
bean实例名 = (bean所属类) ctx.getBean("【bean的名称】");
例如: