zoukankan      html  css  js  c++  java
  • thymeleaf依赖以及一些图片、文件、cdn的导入问题

    导入依赖

    <dependency>
    <groupId>org.thymeleaf</groupId>
    <artifactId>thymeleaf-spring5</artifactId>
    </dependency>
    <dependency>
    <groupId>org.thymeleaf.extras</groupId>
    <artifactId>thymeleaf-extras-java8time</artifactId>
    </dependency>
    <html lang="en" xmlns:th="htttp://www.thymeleaf.org">

    使用thymeleaf之前记得加上xmlns以及里面的内容 否则所有thymeleaf都不生效

    导入本地文件包括jsc、ss、img、都需要在前面加上th:src然后用@{}把整个路劲包起来 link则在href中加th类似

    <script type="text/javascript" th:src="@{../static/js/jquery-3.3.1.js}"></script>
    <link th:href="@{/myuser/css/bootstrap.min.css}" rel="stylesheet">

    文本:th:text转义字符  即里面内容的标签内容,th:utext不转义字符

    数组:<h3 th:each ="user:${user}" th:text="{$user}"></h3>

     使用<p th:text="${msg}" th:if="${not #string.isEmoty{msg}}"></p>  可以让标签在msg为空的时候不显示这个<p>标签这个里面的msg是在之前controller里面判断密码错误之后才赋值的。

  • 相关阅读:
    论登陆博客园的时候忘记了密码
    LNOI 2019 旁观记
    [bzoj3790] 神奇项链
    [POI2000] 病毒
    [HAOI2008] 移动玩具
    [codevs1288] 埃及分数
    [hdu1401] Solitaire
    [洛谷P3806] [模板] 点分治1
    [国家集训队] 聪聪可可
    [洛谷P4178] Tree
  • 原文地址:https://www.cnblogs.com/itwxx/p/11980882.html
Copyright © 2011-2022 走看看