在你调用的Servlet中添加如下代码:

public void init(ServletConfig config) {
try {
super.init(config);
SpringBeanAutowiringSupport.
processInjectionBasedOnServletContext(this,config.getServletContext());
} catch (ServletException e) {
e.printStackTrace();
}
}

  

05-16 06:35