以前写SSM项目的时候,项目结构是webapp,所以在代码里./就是相对路径。 但是在resources目录下,这样的写法是
###resources目录项目
######1. **./**表示什么


./表示项目源码根目录
######2. **request.getServletContext().getContextPath()**表示什么




######3. WebUtils.getRealPath(servletContext, path)








######5. 自定义目录 在application.yml里添加
web:
upload-path: ./admin-server/src/main/resources/static/download/
...
spring:
resources:
static-locations: classpath:/resources/,classpath:/static/,file:${web.upload-path}
在项目里
@Value("${web.upload-path}")
private String path;
就可以做指定目录下载上传了。