在Web环境里,会使用ContextLoader构造ApplicationContext后,压进Servlet Context。
由ContextLoaderListener或ContextLoaderServlet,在Web应用启动时完成。
然后在Jsp/Servelet中,可以通过Servlet Context取得ApplicationContext:ApplicationContext context = WebApplicationContextUtils.getWebApplicationContext(application);
由ContextLoaderListener或ContextLoaderServlet,在Web应用启动时完成。
然后在Jsp/Servelet中,可以通过Servlet Context取得ApplicationContext:ApplicationContext context = WebApplicationContextUtils.getWebApplicationContext(application);
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货