spring中註解注入servlet裏面的對象失敗

在servlet裏面重寫以下方法:

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

註解注入的時候使用 @Autowired 來注入,不要使用 @Resource注入

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