I wanted to post my current working solution in case it helps anyone else, or so someone can tear it apart if I'm missing something. I was able to resolve with Spring MVC by defining an external resource handler and redirecting users to this:
@Configuration
public class CustomWebMvcConfigurer implements WebMvcConfigurer {
@Value("${external.resource.location:file:///external/foo/}")
private String externalLocation;
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("/foo/**")
.addResourceLocations(externalResourcesLocation);
}
}
After adding this configuration and placing my external file content in /external/foo/[index.html|js/|css]
, I'm now able to access my externalized content when navigating to localhost:<port>/foo/index.html
without requiring it to be packaged or deployed within my .war
file.