Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Thymeleaf namespace in html files display errors in Netbeans - How can I get it pass HTML checking?

Netbeans HTML checking doesn't like my thymeleaf namespace.

Here is my HTML Thymleaf 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 nicely with Thymeleaf?

like image 689
cosbor11 Avatar asked Jul 24 '15 06:07

cosbor11


2 Answers

Try to fix it in this way you may ignore spring security thing.

    <!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>
like image 99
mussdroid Avatar answered Nov 09 '22 00:11

mussdroid


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

Simply by adding this to html tag:

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

what's even cooler, netbeans now tracks if you closed every tag with slash "/" in document.

like image 27
Tomasz Mularczyk Avatar answered Nov 08 '22 23:11

Tomasz Mularczyk