大家好,之前寫過一篇配置tomcat訪問服務器本地資源的,但現在使用了springboot內嵌tomcat\jeyyt后,怎么來訪問本地資源呢?
打好springboot框架后,在application.properties文件里配置幾項東西:
##添加本地資源,必須以/結尾,訪問http://ip:port/webname/11.jpg
web.upload-path=C:/FounderTemp/boc_cbs/
spring.mvc.static-path-pattern=/**
spring.resources.static-locations=classpath\:/META-INF/resources/,classpath\:/resources/,classpath\:/static/,classpath\:/public/,file\:${web.upload-path}
classpath:/static/,classpath:/public/,file:${web.upload-path}
重啟程序應該就可以了
