Java 是否可以包含thymeleaf片段的格式
我正在寻找一种方法,将thymeleaf片段的结构包含到页面中。Java 是否可以包含thymeleaf片段的格式,java,spring-mvc,spring-boot,thymeleaf,Java,Spring Mvc,Spring Boot,Thymeleaf,我正在寻找一种方法,将thymeleaf片段的结构包含到页面中。 我的意思是: <div class="container" th:fragment="container"> <div class="row"> {the content of the page continues here} </div> </div> fragmend的定义如下: <div class="container" th:frag
我的意思是:
<div class="container" th:fragment="container">
<div class="row">
{the content of the page continues here}
</div>
</div>
fragmend的定义如下:
<div class="container" th:fragment="container">
<div class="row">
{the content of the page continues here}
</div>
</div>
{页面内容在此继续}
页面模板:
<div th:replace="fragments/main:: container">
{I can continue here for eq, <div class="col-md-5"></div>}
</div>
{我可以在这里继续eq,}
我不知道这是否可行,但我正在寻找一种方法来做到这一点。由于,这可以通过添加
到所需的布局,并将其用作视图中的父元素。查找视图布局方言。