Book Image

Mastering Spring Application Development

By : Anjana Mankale
Book Image

Mastering Spring Application Development

By: Anjana Mankale

Overview of this book

Table of Contents (19 chapters)
Mastering Spring Application Development
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Chapter 11. Spring with Thymeleaf Integration

Thymeleaf is a template engine that is completely written in Java. It supports XML/XHTML/HTML5, and that means we can develop templates using XML or XHTML or HTML5 using the Thymeleaf template engine library. It provides an optional module for Spring MVC and Spring Web Flow integration. Template engines help us to create reusable components in the UI. Template usually by convention consists of a header, menu, message, body, content and footer components. The content part is loaded dynamically with messages. We can create different layouts with a template.

Thymeleaf can be used instead of JSP. We have so far used tiles with JSP for making templates with custom tags. Thymeleaf templates are XHTML, XML, HTML5 template engines. Even web designers can easily interact with it. The expression language used is very much advanced compared to the JSP expression language.

In this chapter, we shall demonstrate how to integrate Spring MVC with the Thymeleaf...