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的更多相关文章

  1. (二)SpringBoot2.0基础篇- 静态资源的访问及Thymeleaf模板引擎的使用

    一.描述 在应用系统开发的过程中,不可避免的需要使用静态资源(浏览器看的懂,他可以有变量,例:HTML页面,css样式文件,文本,属性文件,图片等): 并且SpringBoot内置了Thymeleaf ...

  2. SpringBoot2.1.6 + Shiro1.4.1 + Thymeleaf + Jpa整合练习

    首先,添加maven依赖,完整的pom文件如下: <?xml version="1.0" encoding="UTF-8"?> <projec ...

  3. 4_1.springboot2.xWeb开发使用thymeleaf

    1.简介 如果使用SpringBoot: 1).创建SpringBoot应用,选中我们需要的模块: 2).SpringBoot已经默认将这些场景配置好了,只需要在配置文件中指定少量配置就可以运行起来: ...

  4. springboot2.0整合shiro出现ShiroDialect报错 找不到org/thymeleaf/processor/attr/AbstractTextChildModifierAttrPr

    包版本过低,找最新包 https://mvnrepository.com/ <dependency> <groupId>com.github.theborakompanioni ...

  5. SpringBoot2.x|Thymeleaf页面不能正常载入css、js文件

    1.实现实现WebMvcConfig配置类可以解决页面不能加载css,js的问题: 扩展SpringMvc,编写一个配置类(@Configuration),是WebMvcConfigurationAd ...

  6. SpringBoot2.x开发案例之整合Quartz任务管理系统

    基于spring-boot 2.x + quartz 的CRUD任务管理系统,适用于中小项目. 基于spring-boot +quartz 的CRUD任务管理系统: https://gitee.com ...

  7. Springboot2新特性概述

    官方说明: https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-2.0-Release-Notes 起码 JDK 8 和支持 ...

  8. Activiti(二) springBoot2集成activiti,集成activiti在线设计器

    摘要 本篇随笔主要记录springBoot2集成activiti流程引擎,并且嵌入activiti的在线设计器,可以通过浏览器直接编辑出我们需要的流程,不需要通过eclipse或者IDEA的actiB ...

  9. thymeleaf标签必须由匹配的结束标记终止

    问题描述 springboot使用Thymeleaf标签时会报元素类型必须由匹配的结果标记终止. 如下所示 如果我们一个个的给这些元素后面加上终止标记也是件很麻烦的事~~~~ 解决办法 方法一: 在p ...

随机推荐

  1. 2019牛客暑期多校训练营(第八场)I-Inner World DFS序+主席树(扫描线也可)

    题目传送门 题意:初始有n棵树,每棵树都只有1个n号节点,现在有m次添加操作,每次操作是将$[l,r]$范围内的树的$u$节点后面添加一个$v$节点.每个v节点只会被添加一次. 然后是q次询问,输出$ ...

  2. Error: Cannot find module '@babel/core'

    报错如下 产生原因 babel-loader和babel-core版本不对应所产生的, babel-loader 8.x对应babel-core 7.x babel-loader 7.x对应babel ...

  3. event.target.tagName

    html中 event.target.tagName 中的tagName属性他返回的就是元素标签的大写名称 例如标签他的tagName就是EM 所以用大写 记住:在 HTML 中,tagName 属性 ...

  4. 关于 第三方接口支付的时候 采用post提交的方式,有两种 一种是通过 curl来进行,一种是通过js当页面加载完后跳转

    这是第一种.通过javascript页面加载完后,对表单采用 post方式提交给 第三方接口----- echo <<<_END<!DOCTYPE html PUBLIC &q ...

  5. Java 多线程 - 原子操作AtomicInteger & CAS(Compare-and-Swap)

    原子类简介:https://www.cnblogs.com/stephen0923/p/4505902.html AtomicInteger 介绍: https://yuwenlin.iteye.co ...

  6. 关于OpenLiveWriter出错的修补方法

    OpenLiveWriter使用一段时间后可能会打不开,提示错误如下: 这是只需要把电脑的.net更新到4.6以上版本就可以了.

  7. spring mvc多环境下配置文件的设置

    在实际开发时经常需要把一些配置信息写在配置文件,比如mysql的主机地址.端口号.用户名和密码等.另外,在开发代码时可能用一套配置参数,而部署到测试环境时又会用另一套配置参数,测试完毕再部署到线上环境 ...

  8. (转)Android 升级 ADT 之后报错之一 case语句 .

    转:http://blog.csdn.net/wchinaw/article/details/7325641 下面文章大意是指:在一般的Android项目中,R类的常量都是用final定义的,但ADT ...

  9. JS 基本的介绍

    JS中的注释   HTML的注释:<!—注释内容-->   CSS注释:/* 注释 */   JavaScript的注释:// 或 /*  多行注释 */ 变量 1.变量的概念 变量是变化 ...

  10. Vue 中 computed ,watch,methods 的异同

    methods,watch和computed都是以函数为基础的. computed 和 watch 都可以观察页面的相应式数据的变化.当处理页面的数据变化时,我们有时候很容易滥用watch, 而通常更 ...