让非spring对象实现自动注入功能

 

 

WebApplicationContext ctx = WebApplicationContextUtils.getRequiredWebApplicationContext(filterConfig.getServletContext());
AutowireCapableBeanFactory beanFactory = ctx.getAutowireCapableBeanFactory();
beanFactory.autowireBean(this);
 

 

 

你可能感兴趣的:(spring)