Home  >  Article  >  Java  >  Tags that may be used when java uses Thymeleaf

Tags that may be used when java uses Thymeleaf

青灯夜游
青灯夜游forward
2018-10-25 17:32:203016browse

The content of this article is to introduce the tags that may be used when Java uses Thymeleaf. It has certain reference value. Friends in need can refer to it. I hope it will be helpful to you.

1. onclick event

<a th:onclick="&#39;javascript:more()&#39;" ></a>

2.Introduce CSS style

<link th:href="@{fore/css/public.css}" rel="stylesheet">

3.Introduce js file

<script th:src="@{fore/js/index.js}" type="text/javascript"></script>

4. Introduce header information and tail information

Note: Introduce header and tail information on the html (folder)/public.html page

619f89fa64175d7f1f96d735ef5b2288 
5b0ed3b07ff24881382791df2145ee02 
6784e28bcbc56a8a85b4b8ed7be5b2a0
f967f2a9fff54bf8c96a6765306570e4
16b28748ea4df4d9c2150843fecfba68 
edaeb6b9c2e9ec3c2530376319f952d5
190658ccb3e8e318fe79e6389c1b2a46
0e0b7e467ac92c36ff8e73785a209cce
7f89a3afa15a4bf297f8cbe2f83f3d4b16b28748ea4df4d9c2150843fecfba68

5. Import pictures

 <img th:src="@{fore/images/nav_icona.png}"/>

6. Page traversal

 <li th:each="item,i:${list}"></li>

7.if judgment and th:text value

89e9c047f3c5c24aa4ecad1ab075c196
    9e8b830c9e8b7498c482101ead9cb38254bdf357c58b8a65c66d7c19c8e4d114
    123bc411653d040d85637be3ae928f1872ac96585ae54b6ae11f849d2649d9e6
54bdf357c58b8a65c66d7c19c8e4d114

8.Time type formatting

 <span th:text="${#dates.format(item.updateTime,&#39;yyyy/MM/dd HH:mm&#39;)}"></span>

9. Customize label attributes

 <p th:attr="_tId=${item.taskId}">

10. Get css style

<i class=&#39;fa fa-database&#39;></i>

Note: Get 721a9a9612fc2802710e738db1353767e3365e6e032d1ab542c2846506c683ae When setting the icon style, the 5a8028ccc7a7e27417bff9f05adf5932 tag cannot be written in the value of th:text 45a2772a6b6107b401db3c9b82c049c2. Another '45a2772a6b6107b401db3c9b82c049c2' tag does not belong to the same value as the 6761c325b3aa794b12dfd8fc089e2e0f (as shown below)

89e9c047f3c5c24aa4ecad1ab075c196
     9e8b830c9e8b7498c482101ead9cb38254bdf357c58b8a65c66d7c19c8e4d114 
     123bc411653d040d85637be3ae928f1872ac96585ae54b6ae11f849d2649d9e6
54bdf357c58b8a65c66d7c19c8e4d114

This way you can get 4bac0932168f73039f6e8d7af13106a3e3365e6e032d1ab542c2846506c683ae Icon style

The above is the detailed content of Tags that may be used when java uses Thymeleaf. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:cnblogs.com. If there is any infringement, please contact admin@php.cn delete