在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注入