How to Inject bean into a java Filter

Use WebApplicationContextUtils:

public void init(FilterConfig cfg) { 
    ApplicationContext ctx = WebApplicationContextUtils
      .getRequiredWebApplicationContext(cfg.getServletContext());
    this.bean = ctx.getBean(YourBeanType.class);
}