java/ html/ netbeans/ thymeleaf

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:

在此处输入图片说明

How can I get Netbeans to play nicely with Thymeleaf?

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>

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.

暂无
暂无

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

Related Question How can i get a acces to the optional value in html file by thymeleaf? How do I display data into two column with Thymeleaf and HTML? Intellij IDEA 9: How can I disable the highlighting of errors in HTML files? how to pass the object in html using thymeleaf How to pass multiple parameters from thymeleaf html to thymeleaf dialect processor How to get HTML's thymeleaf value in javascript? how to get the result (html) of thymeleaf resolver? How to use Java get function on Thymeleaf HTML? Display data on HTML using Thymeleaf How to display list errors in thymeleaf?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM