- 博客(8)
- 收藏
- 关注
原创 springboot-thymeleaf - 内嵌变量和布局
……上一章 thymeleaf - 下拉单选多选下一章 thymeleaf - 布局th:include/th:replace
2020-03-26 20:55:31 500
原创 springboot - thymeleaf - 三元(三目)运算
语法是:"条件表达式 ? 表达式1 : 表达式2"条件表达式true执行表达式1、反之执行 表达式2后台:controller 使用Model传递属性值model.addAttribute("sex", "女");html:th:text<div th:text="${sex} == '男' ? '男士':'非男士' "></div><div t...
2020-03-25 18:39:23 3703
原创 springboot-thymeleaf的使用 - 循环
th:each……上一章 thymeleaf - 判断下一章 thymeleaf - 三元(三目)运算
2020-03-24 21:21:16 2488
原创 springboot-thymeleaf的使用 - 判断
if、unless、switchth:ifth:unlessth:switch 和 th:caseth:if返回值决定标签的显示与否,语法 th:if="${boolean表达式}"若boolean表达式不成立、无效。则会显示标签controller: hello方法@RequestMapping("/hello") public String hello(Model model){...
2020-03-24 21:13:56 455
原创 springboot-thymeleaf的使用 - url
thymeleaf路径格式 @{/url}th:href="@{/}" 项目根路径,相当于jsp中 href="${pageContext.request.contextPath}" <a th:href="@{/user/list}">查询用户列表</a>访问路径带参数(常量和变量),多个参数使用,号隔开<a th:href="@{/user/byNam...
2020-03-24 14:57:52 403
原创 springboot-thymeleaf的使用(1)
html页面接受内容th:text 文本th:text和th:utext的区别th:value 值th:text 文本th:text 替换标签里的内容:controller中跳转带参数name值 html页面使用${属性名}获取变替换span标签中的内容访问 http://localhost:8080/hellotext内容拼接使用单引号’ '和+拼接<span th...
2020-03-24 14:14:37 151
原创 springboot整合thymeleaf
springboot整合thymeleaf一、idea建个springboot项目二、pom.xml添加thymeleaf依赖三、application.properties文件中配置访问路径四、建html页面thymeleaf:一个跟 Velocity、FreeMarker 类似的模板引擎,最大的特点是能够直接在浏览器中打开并正确显示模板页面,而不需要启动整个Web应用。可以完全代替JSP(使...
2020-03-23 22:10:19 135
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人