How to connect HttpServlet with Spring Application Context in web.xml?

后端 未结 2 1182
死守一世寂寞
死守一世寂寞 2020-12-18 06:41

I\'m trying to connect my FooServlet which extends HttpServlet with the ApplicationContext which is in the same Project. The Application Context is already used by a Wicket

2条回答
  •  离开以前
    2020-12-18 07:20

    I think you should use Spring utilities like RequestContextUtils.getWebApplicationContext(request, application); to hookup the Spring Context within your Servlet. Agreed this is no DI/IoC, but the servlet is no bean as well !

提交回复
热议问题