Spring injection in Filter implementation mapped in web.xml
问题 web.xml: <filter> <filter-name>myFilter</filter-name> <filter-class>com.mypackage.MyFilter</filter-class> </filter> <filter-mapping> <filter-name>myFilter</filter-name> <url-pattern>/myFilterPattern/*</url-pattern> </filter-mapping> MyFilter: public class MyFilter implements Filter { @Autowired InjectedBean someInjectedBean; However, when intercepting /myFilterPattern/* requests, someInjectedBean in MyFilter.doFilter(...) is still null, meaning it has not been injected. The same bean (