ContextLoader和WebApplicationContextUtils获取WebApplicationContext?

ContextLoader.getCurrentWebApplicationContext()和WebApplicationContextUtils.getWebApplicationContext(ServletContext servletContext)区别是什么?两个方法都能得到WebApplicationContext,请问有什么区别?为什么WebApplicationContextUtils.getWebApplicationContext需要ServletContext作为参数,而它却更多被使用?

阅读 4.1k
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题