
正文
SpringBoot-(10)配置虚拟路径-指定外部路径文件夹存取文件
提示:扫一扫查出行【扫一扫了解最新限行尾号】
复制提示
参考:https://blog.csdn.net/feng2147685/article/details/95623135
package com.online.director;import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;/**
* Created by zhang_guang_yang on 2019/11/1.
*/
@Configuration
public class OnlineDirectorWebAppConfigurer extends WebMvcConfigurerAdapter { @Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("/server/**").addResourceLocations("file:/Users/zhang_guang_yang/Python/server/");
super.addResourceHandlers(registry);
}
}






