springboot添加自定义资源 @Configurationpublic class ResourceConfig extends WebMvcConfigurationSupport {@Value("${url.proj}")private String resProject;@Overrideprotected void addResourceHandlers(ResourceHandlerRegistry registry) { //指
@Configuration public class ResourceConfig extends WebMvcConfigurationSupport { @Value("${url.proj}") private String resProject; @Override protected void addResourceHandlers(ResourceHandlerRegistry registry) { //指定目录资源 registry.addResourceHandler("/data/project/**").addResourceLocations("file:" + resnProject); //classpath目录资源 registry.addResourceHandler("/**").addResourceLocations("classpath:/static/"); super.addResourceHandlers(registry); } }