The Thymeleaf namespace in html files displays errors in Netbeans. How can I get its HTML check?

Validating Netbeans HTML does not like my thymeleaf namespace.

Here is my Thymleaf HTML file :

<!DOCTYPE html> <html xmlns:th="http://www.thymeleaf.org"> <head th:fragment="head"> <object th:include="fragments/meta :: meta" th:remove="tag" /> <link href='http://fonts.googleapis.com/css?family=Source+Sans+Pro:400,700|Open+Sans:300italic,400,300,700' rel='stylesheet' type='text/css'/> <link href="/../../../webjars/Semantic-UI/2.0.6/semantic.min.css" rel="stylesheet" th:href="@{/webjars/Semantic-UI/2.0.6/semantic.min.css}"/> <link href="../../../css/core.css" rel="stylesheet" th:href="@{/css/core.css}" /> <link href="../../../css/product.css" rel="stylesheet" th:href="@{/css/product.css}" /> </head> <body> </body> </html> 

This is the error displayed in Netbeans:

enter image description here

How can I get Netbeans to play well with Thymeleaf?

+5
source share
2 answers

Try fixing it in such a way that you can ignore spring.

  <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity3"> <head> <meta charset="utf-8"/> <title>Sample</title> <link th:href="@{/resources/css/bootstrap.css}" rel="stylesheet" type="text/css"/> <link th:href="@{/resources/css/bootstrap-theme.css}" rel="stylesheet" type="text/css"/> </head> 
+6
source

I found out how to disable these errors when I was taking this spring security tutorial

Just adding this to the html tag:

 xmlns="http://www.w3.org/1999/xhtml" 

even colder, netbeans now keeps track of if you have closed each tag with a slash "/" in the document.

+1
source

All Articles