ApplicationContext ctx = WebApplicationContextUtils.getWebApplicationContext(request.getSession().getServletContext())
本文介绍了一种从ServletContext中获取Spring ApplicationContext的方法。通过使用WebApplicationContextUtils工具类的静态方法getWebApplicationContext,可以轻松地从当前的ServletContext中获得ApplicationContext实例。
ApplicationContext ctx = WebApplicationContextUtils.getWebApplicationContext(request.getSession().getServletContext())
1219

被折叠的 条评论
为什么被折叠?