导航

spring 获取 ApplicationContext

Posted on 2017-05-03 11:06  yjss  阅读(94)  评论(0编辑  收藏  举报

获取ApplicationContext

1、WebApplicationContext webApplicationContext = ContextLoader.getCurrentWebApplicationContext();

2、WebApplicationContextUtils.getWebApplicationContext(servletContext)

3、RequestContextUtils.getWebApplicationContext(request)