Spring boot + thymeleaf in IntelliJ: cannot resolve vars

Update

TL;DR: skip to accepted answer below: https://stackoverflow.com/a/44804086/474034

As mentioned in the comments by multiple people, this solution is not correct. The Thymeleaf documentation (see http://thymeleaf.org/doc/tutorials/3.0/usingthymeleaf.html), have in all their examples a version with www. included:

<html xmlns:th="http://www.thymeleaf.org">

See also the Standard-Dialect.xml on Github, which declares namespace-uri as:

namespace-uri="http://www.thymeleaf.org" 

Original Answer

I had two different portions of code: the first was showing the error and the second was not doing it.
I observed that there is a difference in the xmlns:th attribute.

First Page: Not working!

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org">

Second Page: Working!

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://thymeleaf.org">

I removed the www. and it works for me!

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)