spring boot使用freemarker页面获取系统路径最简配置
生活随笔
收集整理的這篇文章主要介紹了
spring boot使用freemarker页面获取系统路径最简配置
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
1、配置application.properties(最后一句起作用,前面湊數的)
spring.freemarker.template-loader-path=classpath:/templates/ spring.freemarker.suffix=.ftl spring.freemarker.cache=false spring.freemarker.charset=utf-8 spring.freemarker.request-context-attribute=request2、頁面獲取方式: ${request.contextPath}
<link rel="stylesheet" href="${request.contextPath}/layui/css/layui.css"/>?
?3、完事,簡單吧
總結
以上是生活随笔為你收集整理的spring boot使用freemarker页面获取系统路径最简配置的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: format 转化时间格式不起作用
- 下一篇: spring boot:java.lan