springboot2 +thymeleaf
springboot 1.5. 9+ thymeleaf
<!--sidebar-->
<nav class="col-md-2 d-none d-md-block bg-light sidebar" th:fragment="sidebar">
<div class="sidebar-sticky">
<ul class="nav flex-column"> <li class="nav-item"> <a class="nav-link active"
th:class="${activeUri=='main'?'nav-link active':'nav-link'}"
href="#" th:href="@{/main}">
<span data-feather="home"></span>
Dashboard <span class="sr-only">(current)</span>
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">
<span data-feather="file"></span>
Orders
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">
<span data-feather="shopping-cart"></span>
Products
</a>
</li> <li class="nav-item"> <a class="nav-link active" href="#" th:href="@{/emps}"
th:class="${activeUri=='emps'?'nav-link active':'nav-link'}">
<span data-feather="users"></span>
员工管理
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">
<span data-feather="bar-chart-2"></span>
Reports
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">
<span data-feather="layers"></span>
Integrations
</a>
</li>
</ul> <h6 class="sidebar-heading d-flex justify-content-between align-items-center px-3 mt-4 mb-1 text-muted">
<span>Saved reports</span>
<a class="d-flex align-items-center text-muted" href="#">
<span data-feather="plus-circle"></span>
</a>
</h6>
<ul class="nav flex-column mb-2">
<li class="nav-item">
<a class="nav-link" href="#">
<span data-feather="file-text"></span>
Current month
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">
<span data-feather="file-text"></span>
Last quarter
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">
<span data-feather="file-text"></span>
Social engagement
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">
<span data-feather="file-text"></span>
Year-end sale
</a>
</li>
</ul>
</div>
</nav>
在另一个页面引用的时候,传递参数
<div th:replace="commons/bar::#sidebar(activeUri='emps')"></div>
在springboot 2+ thymeleaf 的时候引用就要使用
<div th:replace="commons/bar :: sidebar('activeUri'='emps')"></div>
在参数上也要加上引号,踩坑
springboot2 +thymeleaf的更多相关文章
- (二)SpringBoot2.0基础篇- 静态资源的访问及Thymeleaf模板引擎的使用
一.描述 在应用系统开发的过程中,不可避免的需要使用静态资源(浏览器看的懂,他可以有变量,例:HTML页面,css样式文件,文本,属性文件,图片等): 并且SpringBoot内置了Thymeleaf ...
- SpringBoot2.1.6 + Shiro1.4.1 + Thymeleaf + Jpa整合练习
首先,添加maven依赖,完整的pom文件如下: <?xml version="1.0" encoding="UTF-8"?> <projec ...
- 4_1.springboot2.xWeb开发使用thymeleaf
1.简介 如果使用SpringBoot: 1).创建SpringBoot应用,选中我们需要的模块: 2).SpringBoot已经默认将这些场景配置好了,只需要在配置文件中指定少量配置就可以运行起来: ...
- springboot2.0整合shiro出现ShiroDialect报错 找不到org/thymeleaf/processor/attr/AbstractTextChildModifierAttrPr
包版本过低,找最新包 https://mvnrepository.com/ <dependency> <groupId>com.github.theborakompanioni ...
- SpringBoot2.x|Thymeleaf页面不能正常载入css、js文件
1.实现实现WebMvcConfig配置类可以解决页面不能加载css,js的问题: 扩展SpringMvc,编写一个配置类(@Configuration),是WebMvcConfigurationAd ...
- SpringBoot2.x开发案例之整合Quartz任务管理系统
基于spring-boot 2.x + quartz 的CRUD任务管理系统,适用于中小项目. 基于spring-boot +quartz 的CRUD任务管理系统: https://gitee.com ...
- Springboot2新特性概述
官方说明: https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-2.0-Release-Notes 起码 JDK 8 和支持 ...
- Activiti(二) springBoot2集成activiti,集成activiti在线设计器
摘要 本篇随笔主要记录springBoot2集成activiti流程引擎,并且嵌入activiti的在线设计器,可以通过浏览器直接编辑出我们需要的流程,不需要通过eclipse或者IDEA的actiB ...
- thymeleaf标签必须由匹配的结束标记终止
问题描述 springboot使用Thymeleaf标签时会报元素类型必须由匹配的结果标记终止. 如下所示 如果我们一个个的给这些元素后面加上终止标记也是件很麻烦的事~~~~ 解决办法 方法一: 在p ...
随机推荐
- DEV的GridControl控件的选中列属性设置高光
设置Run Designer=>Views=> OptionsSelection下面的: EnableAppearanceFocusedCell = False,//鼠标移开,失去焦点,仍 ...
- python的异常捕捉
你可能会说既然有万能异常Exception,那么我直接用上面的这种形式就好了,其他异常可以忽略 你说的没错,但是应该分两种情况去看 1.如果你想要的效果是,无论出现什么异常,我们统一丢弃,或者使用同一 ...
- C++ 系列:函数可变长参数
一.基础部分 1.1 什么是可变长参数 可变长参数:顾名思义,就是函数的参数长度(数量)是可变的.比如 C 语言的 printf 系列的(格式化输入输出等)函数,都是参数可变的.下面是 printf ...
- windows2012 日志查看过程
Windows2012界面修改好造成有些人不知道在哪里查找windows 日志 我这边截图描述一下 1. 2.输入 命令 eventvwr.msc 3.弹出 windows 事件查看器 4.若需要 ...
- File转换为MultipartFile工具类
package cn.com.utils; import org.apache.commons.fileupload.FileItem; import org.apache.commons.fileu ...
- python: 函数递归与尾递归
如果一个函数在内部调用自己,那么这个函数就是递归函数. 例如一个阶乘函数:fact(n)=n! ,其实可以写成 fact(n)=n x fact(n-1). fact(n) 以递归的方式可以表示为: ...
- Ubuntu下github pages+hexo搭建自己的博客
hexo 是一个基于Node.js的静态博客程序,可以方便的生成静态网页托管在github上.Hexo简单优雅, 而且风格多变, 适合搭建个人博客,而且支持多平台的搭建. 平台 Ubuntu14.04 ...
- Mysql中“select ... for update”排他锁(转)
原帖地址 https://blog.csdn.net/claram/article/details/54023216 Mysql InnoDB 排他锁 用法: select … for update; ...
- (一)PHP基础知识考察点
1,PHP引用变量的考察点: 概念:引用就是用不同的名字访问同一个变量内容. 定义方式: 使用&符号. PHP引用变量的工作原理 这里有个COW copy on write 用zval() ...
- 安装MySql社区版(35-3)
1,https://dev.mysql.com/ --------------------------------------------------------------------------- ...