[JAVA] [Thymeleaf] Thinking when An error happened during template parsing appears

I am a beginner. Often for beginners, Write → Fix → Bug → Fix → Bug ... The span of is short. I want to make it as short as possible.

For that purpose, I would like to make a template of what to do when a similar error occurs.

environment

windows10 spring boot 2.4.0 thymeleaf 3.0.11

Error message

There was an unexpected error (type=Internal Server Error, status=500).
An error happened during template parsing (template: "class path resource [templates/Template name]")

This error happens anyway. Often happens in Hongma

Where to fix it to happen

  1. Controller
  2. html

If you change the name of the object passed to the view of the controller or the contents stored in it, the reception in the view fails.

When thml was modified, thymeleaf was often written incorrectly. In particular th:text="${customer" It happens quite often that the last } is missing.

It's not that I forgot the following, but it is a convenient and inconvenient function that if you delete either {}, both will be erased with the editor's completion function, It disappeared unintentionally. It means that there are times.

Search for HTML view issues

It's hard to read all the errors displayed on the page

Shortcut
Ctrl + F
//Search by "line"

Then you can find out what line of the HTML file the error is occurring.

I think there are other appropriate solutions, but for me as a beginner, this is an error that can almost be solved.

Recommended Posts

[Thymeleaf] Thinking when An error happened during template parsing appears
A reminder when an aapt.exe error occurs