5

Using NetBeans 8.1.

I have a SpringBoot project that uses Thymeleaf as template, everything is working but in the html page when i use the tag

<html lang="en-US" xmlns:th="http://www.thymeleaf.org">

i have the error Attribute with the local name "xmlns:th" is not serializable as XML 1.0, i can use thymeleaf functions like th:each or th:text but they always show the same error and i'm not able to have suggestions when typing, is there a way to fix this ?

4 Answers 4

8

Adding xmlns="http://www.w3.org/1999/xhtml" fixes the errors in netbeans. I've not been able to get suggestions to work.

<html lang="en-US" xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
Sign up to request clarification or add additional context in comments.

1 Comment

Please do not merely post code but instead do explain.
1

Use this third party plugin, you just need to download the plugin and then inside Netbeans go to:

• Tools -> Plugins -> Downloaded -> Add plugins

Search the downloaded plugin and install it. Reboot Netbeans and now you have thymeleaf code completion.

Also I have added xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org" Inside the tag.

2 Comments

Please include the relevant information in your answer.
The third party plugin in the link worked fine for me in Netbeans 20. It's named 'NB-Thymeleaf-Code-Completion' and the latest release on GitHub dates back to 2019.
0

Just ignore it. That's why probably the IDE it is not handling (or have not a suitable plugin for) the Thymeleaf schema and thus it is throwing a validation error, but it doesn't affect your application or Thymeleaf compilation.

Comments

0

I had a similar issue in the past, however I was using the tag in a html document that was in a static folder. My understanding is that it would have to be in templates folder under resource folder. Its suppose to be a dynamic page so it would make sense if it doesn't work in a static folder. Hope this helps. dependencyoutput on localhost code in @controller dynamic html code

1 Comment

Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.