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 转化时间格式不起作用
- 下一篇: 在windows下将Tomcat设置为自