Solve the problem of thymeleaf variables reporting red in HTML
Report red as follows:
The first
- Add it to the head of the HTML file (only the red flag for the added HTML file can be solved)
<!--suppress ThymeleafVariablesResolveInspection -->
Reporting red will solve the problem
The second type
Turn off IDEA's data validation option for thymeleaf in the settings (resolve red flags for all HTML files at once).
The first option: report incorrect elements in the thymeleaf Dialect extension file.
The second option: report unparsed message resource keys.
Third option: Report unresolved references and invalid thymeleaf expressions.
Search for Thymeleaf in File–>setting–>Editor–>Inspection and uncheck the underlined part–>Apply- personal opinion:
- 1. Canceling the first option can only solve part of the problem of red reporting. For example, whether the value of a key-value pair is still reporting red, you can try to cancel the second option√
- 2. Even if you cancel the second √, some red reports will still appear, but if you cancel the three options at the same time, all variables will not report red (the disadvantage is that invalid ones cannot be found, so use with caution)
- 3. Please use it according to your own needs. As an obsessive-compulsive person, I directly canceled all the bonuses and all the bonuses disappeared, which was very comfortable.