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 ?
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.
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.
No, you can’t include jsp files in thymeleaf. But you can include other thymeleaf pages. See how :
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With