Configuration of application.yml
server:
port: 1199 #端口号
servlet:
context-path: /fili #访问路径
spring:
mvc:
view:
prefix: /WEB-INF/jsp/
suffix: .jsp
#虚拟路径 访问
static-path-pattern: /imge/**
#图片存放的真实路径
resources:
static-locations: file:D://img/
After the configuration is complete, you can access resources by virtual path