When we create a html file in the templates directory in a spring boot project integrated with Thymeleaf view, we will find the namespace ‘th’ is unavailable.
If you hover your mouse to see the hint, it will alert like this: namespace ‘th’ is not found.
The reason for this is, your manually created html doesn’n include the xmlns into this html file. while xmlns stands for ‘xml name space’. like this
So here is we are gonna do, just include this two lines into the html tag
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="UTF-8">
<title>first thymeleaf demo</title>
</head>
<body>
<span th:text="Hello"></span>
<hr/>
<span th:text="${msg}"></span>
</body>
</html>
Problem solved.