first commit
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
package lingtao.net.config;
|
||||
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
|
||||
|
||||
@Configuration
|
||||
public abstract class ResourceServerConfig implements WebMvcConfigurer {
|
||||
|
||||
private String localPrefix = "abc";
|
||||
|
||||
private String localPath = "F:\\java_project\\bj\\upload";
|
||||
|
||||
@Override
|
||||
public void addResourceHandlers(ResourceHandlerRegistry registry) {
|
||||
registry.addResourceHandler("/" + localPrefix + "/**")
|
||||
.addResourceLocations("file:" + localPath);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user