如何配置springboot一訪問服務器本地圖片

你們好,以前寫過一篇配置tomcat訪問服務器本地資源的,但如今使用了springboot內嵌tomcat\jeyyt後,怎麼來訪問本地資源呢?web

打好springboot框架後,在application.properties文件裏配置幾項東西:spring

##添加本地資源,必須以/結尾,訪問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}tomcat

 重啓程序應該就能夠了springboot

相關文章
相關標籤/搜索