在servlet里面重写以下方法:
public void init(ServletConfig config) throws ServletException {
SpringBeanAutowiringSupport.processInjectionBasedOnServletContext(this, config.getServletContext());
}
注解注入的时候使用 @Autowired 来注入,不要使用 @Resource注入
在servlet里面重写以下方法:
public void init(ServletConfig config) throws ServletException {
SpringBeanAutowiringSupport.processInjectionBasedOnServletContext(this, config.getServletContext());
}
注解注入的时候使用 @Autowired 来注入,不要使用 @Resource注入