在过滤器中通过spring下上文获取bean

在过滤器中通过spring上下文获取bean在过滤器中通过spring上下文获取beanpublic void init(FilterConfig a

在过滤器中通过spring上下文获取bean
在过滤器中通过spring上下文获取bean

public void init(FilterConfig arg0) throws ServletException {ApplicationContext appC=  WebApplicationContextUtils.getWebApplicationContext(arg0.getServletContext());DemoBean demoBean = (DemoBean)appC.getBean("demoBean");}