linux环境配置先访问服务器对应图片(Spring Boot)

@Component
class WebConfigurer extends WebMvcConfigurerAdapter {
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("/actilce/file/**").addResourceLocations("file:///home/work/uploaded_files");
}
}

访问路径:http://******:8099/actilce/file/home.jpg

你可能感兴趣的:(linux环境配置先访问服务器对应图片(Spring Boot))