Thymeleaf Interactive Tutorial

Exercise 2: simple formatting

This exercise introduces concepts from chapter 16 of the Using Thymeleaf manual.

  1. Edit the source code in order to show bean values as you did in exercise 1.
    A bean of class Product has been already set into the context model with variable name product.
  2. Now let's add some formatting to those Integer and Date properties. For this, have a look at the definition of the #dates and #numbers utility objects at the Expression Utility Objects Appendix of the Using Thymeleaf tutorial.
  3. Finally, modify the template in order to obtain a static prototype that makes sense (for example, by substituting all those XXX by some prototyping data).
  4. You can check the proposed solution by pressing the Show solution button () above the code editor.

Welcome to the Thymeleaf Interactive Tutorial. Thymeleaf version used in this tutorial is 2.1.5.RELEASE.

This interactive tutorial has been created by the Thymeleaf Team using The Thymeleaf Template Engine and other great open source tools like:

The tutorial is gracefully hosted at the Heroku Cloud Platform

Icons used in this app, except Thymeleaf logo, are created by Mark James

You can get the source code of this tutorial at GitHub.

You can find much more documentation on Thymeleaf at the Thymeleaf website.

For any questions or help, you can use the user forum.

Source code

Static view

Generated source

Dynamic view