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. cvErode和cvDilate腐蚀和膨胀函数

    Erode腐蚀,Dilate膨胀,这两个形态学函数总是成对出现,前者可以消除较小独点如噪音,后者可以使不连通的图像合并成块. void cvErode( const CvArr* src, CvArr ...

  2. vc面试题目

    class B { public: B() { cout << "default constructor" << endl; } ~B() { cout & ...

  3. poj1363 Rails Central Europe 1997

    P.S.: 输出换行 三个方法 1.直接按照要求做 根据给的数,需要push,pop哪些数据,具有唯一性 数最多进栈一次,出栈一次 O(n) Source Code Problem: User: co ...

  4. leetcood学习笔记-82-删除排序链表中的重复元素二

    题目描述: 方法一: class Solution(object): def deleteDuplicates(self, head): """ :type head: ...

  5. 线性dp——cf1096D

    dp[i][j]表示到第i位,与hard的匹配状态到达了第j位 每位有两种决策:消或者不消 分别转移一下即可 转移代码 ;i<n;++i) ;j<=;++j) { cmin(f[i+][j ...

  6. (转)Wireshark "The NPF driver isn’t running…"(

    转:http://blog.sina.com.cn/s/blog_4bfd07180100e3ar.html 前几天重装系统,装上了windows7 RC系统.昨天开始尝试装上了wireshark 这 ...

  7. Vue-Grid-Layout分享一款好用的可拖拽组件

    在使用Grafana的过程中,发现Grafana关于视图页面中每一个面板都可拖拽,可随意放大放小,体验非常棒,F12看了Grafana的代码,看打包后的代码很像react,进一步css,看到有grid ...

  8. 使用JDK自带功能,实现一个简单的Web Service接口发布

    万事开头难,本篇文章的目的就是使用JDK自带的功能,实现一个最简单的Web Service接口的发布. 下图是项目的组成,主要有三个部分,一个接口(WS),一个接口的实现类(WSImp),还有一个接口 ...

  9. Hive学习详细版

    一.概述 1.Hadoop的开发问题 只能用java语言开发,存在语言门槛 需要对Hadoop底层原理,api比较了解才能做开发 开发调试比较麻烦 2.什么是Hive Hive是基于Hadoop的一个 ...

  10. Web开发-Servlet&HTTP&Request

    <!doctype html>02 - JavaEE - Servlet&HTTP&Request figure:first-child { margin-top: -20 ...