Sunday, October 2, 2016

Autowiring into filter in Spring application

If you are facing problems autowiring dependencies in your filter class in Spring application Use the following trick.




@Override
public void doFilter(ServletRequest request, ServletResponse response, FilterChain filter)
throws IOException, ServletException {
SpringBeanAutowiringSupport.processInjectionBasedOnCurrentContext(this);
...
...
...
...
...
}

No comments: