Closed
Description
I'm trying to intercept certain URL patterns to resolve into the correct UrlResource
, but the application context does not honour custom protocol resolvers.
In pseudocode:
GenericApplicationContext applicationContext = new GenericApplicationContext();
applicationContext.setResourceLoader(someResourceLoader);
applicationContext.addProtocolResolver(new CustomUrlResolver());
applicationContext.getResource("http://some.custom.url/"); // never resolved via CustomUrlResolver
The CustomUrlResolver
resolver is never invoked because someResourceLoader
takes precedence in getResource
. Unfortunately, there's no way to work around this issue by adding a delegating resource loader, since there's no accessor for the resource loader.
I believe that the setResourceLoader(...)
call is done somewhere in Spring Boot.
I had to do setResourceLoader(null)
. This is likely going to break things.