servlet中注入spring管理的bean

原创
2017/01/22 09:13
阅读数 237

在servlet中覆写一下方法即可。

    @Override  
    public void init(ServletConfig config) throws ServletException  
    {  
        SpringBeanAutowiringSupport.processInjectionBasedOnServletContext(this, config.getServletContext());  
    }
展开阅读全文
加载中
点击引领话题📣 发布并加入讨论🔥
打赏
0 评论
0 收藏
0
分享
返回顶部
顶部