在过滤器中通过spring上下文获取bean
public void init(FilterConfig arg0) throws ServletException {
ApplicationContext appC= WebApplicationContextUtils.getWebApplicationContext(arg0.getServletContext());
DemoBean demoBean = (DemoBean)appC.getBean("demoBean");
}