I am trying to add a resource handler into my Spring Boot App (1.1.8.RELEASE) which must be able to convert this example.
//From: {HOST_PREFIX_1}/u/{1}/{2}/myimage.jpg
//To: {CDN_PREFIX_2}/u/{1}/{2}/images/myimage.jpg
I don't know whether spring is able of dealing with this kind of patterns or I have to create a custom resourceHandler.
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry)
{
registry.addResourceHandler("/u/{var1}/{var2}/{var3:.*}")
.addResourceLocations("/u/{var1/{var2}/images/{var3:.*}")
.addResourceLocations(cdnPrefix);
super.addResourceHandlers(registry);
}
Spring does not detect any kind of pattern error but the redirection is not working.
Any help?
Thanks!