欢迎访问 生活随笔!

生活随笔

当前位置: 首页 > 运维知识 > windows >内容正文

windows

spring boot使用freemarker页面获取系统路径最简配置

发布时间:2025/3/15 windows 45 豆豆
生活随笔 收集整理的这篇文章主要介绍了 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=request

2、页面获取方式: ${request.contextPath}

<link rel="stylesheet" href="${request.contextPath}/layui/css/layui.css"/>

 

 3、完事,简单吧

总结

以上是生活随笔为你收集整理的spring boot使用freemarker页面获取系统路径最简配置的全部内容,希望文章能够帮你解决所遇到的问题。

如果觉得生活随笔网站内容还不错,欢迎将生活随笔推荐给好友。