Using the common part of HTML file with thymeleaf
For using the common part in HTML with Thyemleaf
The way to recognized the th:fragment and use it in html.
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
<head th:fragment="common-header"></head>
<div th:fragment="navbar">
Disc: This is the file inside common folder with name header.html
This is the link to declare thyemleaf's address for replace and use the part in another file
<html lang="en" xmlns:th="http://www.w3.org/1000/xhtml">
<div th:replace="common/header :: navbar"/>
Disc: common is the folder and header.html is the file.
Comments
Post a Comment