spring中注解注入servlet里面的对象失败

在servlet里面重写以下方法:

public void init(ServletConfig config) throws ServletException {
        SpringBeanAutowiringSupport.processInjectionBasedOnServletContext(this, config.getServletContext());
}

注解注入的时候使用 @Autowired 来注入,不要使用 @Resource注入

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章