获取applicationContext、获取request
程序员文章站
2022-05-25 10:57:40
...
1.获取applicationContext
ApplicationContext applicationContext= WebApplicationContextUtils.getWebApplicationContext(event.getServletContext());
2.获取request
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();