Closed lincolnthree closed 1 year ago
Link with #362
I think the RequestListener
part is not necessary.
Spring already has an org.springframework.web.context.request.RequestContextListener
and org.springframework.web.filter.RequestContextFilter
which both catch the current request in a ThreadLocal which can be accessed as follows:
HttpServletRequest request = (HttpServletRequest) RequestContextHolder.currentRequestAttributes().resolveReference("request");
From there you could simply use this to get the ApplicationContext:
RequestContextUtils.findWebApplicationContext(request);
Merged into all relevant branches! Thanks everyone for your patience.
This is a re-opened PR continued from https://github.com/ocpsoft/rewrite/pull/368 which was targeted at the now defunct
develop
branch.