Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add other html file in thymeleaf,Is it OK ?

As you know,if we want to include other pages in jsp(most are header 、footer), we can write that in our jsp file:

<jsp:include page="/pages/common/header.jsp"></jsp:include>

if I want to  achieve the same function that adding some html file in thymeleaf template , how can I do? Is it OK ?

like image 878
Ice Blue Avatar asked Jan 21 '17 03:01

Ice Blue


People also ask

Can we use JSP in Thymeleaf?

If you are building web front-ends with Spring Boot or Spring MVC, and you're still using JSP (Java Server Pages) then this course is for you. Thymeleaf is a great templating engine which replaces JSP, and you can easily use it in any Spring MVC or Spring Boot application.

What is the advantage of using Thymeleaf?

Thymeleaf provides useful formatting utilities such as ${#calendars. format(...)} , ${#strings. capitalize(...)} which are well integrated with Spring e.g. you can pass model beans propagated by Spring MVC into these functions. The build/deploy/test feedback loop is shortened by Thymeleaf.


1 Answers

No, you can’t include jsp files in thymeleaf. But you can include other thymeleaf pages. See how :

  • Difference between th:insert and th:replace (and th:include)
like image 136
Maxim Radevich Avatar answered Sep 30 '22 00:09

Maxim Radevich