springboot1配置虚拟路径
分类: Java springboot 专栏: java springboot 标签: springboot1配置虚拟路径
2022-12-16 22:47:37 774浏览
springboot1配置虚拟路径
--------------------
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
@Configuration
public class MyWebMvcConfigurerAdapter extends WebMvcConfigurerAdapter {
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
//registry.addResourceHandler("/upimgs/**").addResourceLocations("file:F:/upimgs/");
registry.addResourceHandler("/upimgs/**").addResourceLocations("file:/usr/myspringboot/renthouse/upimgs/");
}
}
好博客就要一起分享哦!分享海报
此处可发布评论
评论(0)展开评论
暂无评论,快来写一下吧
展开评论
您可能感兴趣的博客
他的专栏
他感兴趣的技术

java
vue
springboot
Mysql
ssm
小程序
uniapp
js和jquery