Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Thymleaf for Spring in IntelliJ - URI is not registered

My home.html file is displaying an error of URI is not registered (Settings|Languages & Frameworks|Schemas and DTDs) in IntelliJ.

The html file to include the namespace is

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

I tried to fetch external resource but this is not working

like image 549
jlog Avatar asked Aug 02 '16 21:08

jlog


People also ask

How do I add Thymeleaf in spring boot IntelliJ?

New Spring project or module with ThymeleafFrom the main menu, select File | New | Project or File | New | Module. In the dialog that opens, select Spring Initializr from the list on the left and click Next. From the Dependencies list, click Template Engines and select the Thymeleaf option. Click Create.

How do I add Thymeleaf?

html file should be placed under the templates directory and all JS and CSS files should be placed under the static directory in classpath. In the example shown, we used CSS file to change the color of the text. Now, we need to add the Spring Boot Starter Thymeleaf dependency in our build configuration file.


3 Answers

The error is not a problem when running the code, but IntelliJ cannot give you codecompletion for the th:* functions.

This is intentional by JetBrains since they specify here: https://www.jetbrains.com/help/idea/thymeleaf.html

To be able to use the Thymeleaf support in IntelliJ IDEA, make sure that the Thymeleaf plugin is enabled. (This plugin is bundled with the IDE and enabled by default.)

and at the top of the page, it says:

This feature is only supported in the Ultimate edition.

I have not yet found a plugin for the Community Edition that will give you Thymeleaf support, but Thymeleaf will work perfectly fine, you just won't get any help from the IDE

like image 105
Anders Olsen Avatar answered Oct 16 '22 13:10

Anders Olsen


Go to : File | Settings | Plugins

click "Install Jetbrains plugin...". find Thymeleaf in the search bar, click install.

restart is required.

like image 39
Wilson Campusano Avatar answered Oct 16 '22 13:10

Wilson Campusano


I resolved issue when I added www.

Originally I added like this -> http://thymeleaf.org

like image 1
wonsuc Avatar answered Oct 16 '22 12:10

wonsuc



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!