Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
ResourceUrlProvider should initialize only once [SPR-12592] #17193
Currently, the ResourceUrlProvider auto-initializes itself on every ContextRefreshedEvent. This breaks down when the application has all beans configured in the root context and uses an empty web application context for its DispatcherServlet. The ContextRefreshedEvent of the latter is handled by the ResourceUrlProvider after it has already properly initialized itself, thereby causing it to empty its handlerMap.
I would suggest to set the
0 votes, 5 watchers
Rossen Stoyanchev commented
Good point. We should consider detecting ResourceHttpRequestHandler's in parent contexts as well. That way the second ContextRefreshedEvent won't come up empty, which leaves the possibility to autodetect with each context refresh.