Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How does springboot use thymeleaf to reference the public part html

2025-01-21 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly introduces "how springboot uses thymeleaf to quote public part html". In daily operation, I believe many people have doubts about how springboot uses thymeleaf to quote public part html. Xiaobian consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful to answer the question of "how springboot uses thymeleaf to quote public part html". Next, please follow the editor to study!

/ / the following example is for reference only, does not write a complete example, and gives the key parts.

/ / use th:fragment= "topbar" to extract and process the common parts of workers.

/ / introduce a common fragment common/bar in another page to represent the bar.html (extracted public page) topbar in the common directory to represent the fragment extracted from bar.html

/ / there are three ways to introduce clips. It is recommended to use the second one.

/ / the following represents the above three ways, and you can see the difference by comparison

©2011 The Good Thymes Virtual Grocery

©2011 The Good Thymes Virtual Grocery

©2011 The Good Thymes Virtual Grocery

/ / the following is about the use of frament expressions, in order to make a css work on a page.

/ / use th:class= "${activeUri=='main.html'?'nav-link active':'nav-link'}" to change class has different css under different requests

/ / the following example shows that under the request of {the relevant path of your project} / main.html, the class= "nav-link active" under the a tag, if not class= "nav-link"

At this point, the study on "how springboot uses thymeleaf to reference the public part of html" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report