Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

thymeleaf code completion not working intellij 14

I am trying to use thymeleaf template engine with Spring MVC with intellij 14, but code completion is not working. please help me.

<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
  <title>Spring Core Online Tutorial</title>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>

  <link href="http://cdn.jsdelivr.net/webjars/bootstrap/3.3.4/css/bootstrap.min.css"
        th:href="@{/webjars/bootstrap/3.3.5/css/bootstrap.min.css}"
        rel="stylesheet" media="screen"/>

  <script src="http://cdn.jsdelivr.net/webjars/jquery/2.1.4/jquery.min.js"
          th:src="@{/webjars/jquery/2.1.4/jquery.min.js}"></script>

  <link href="../static/css/spring-core.css"
        th:href="@{css/spring-core.css}" rel="stylesheet" media="screen"/>
</head>

<body>
<div class="container">
  <h1>Hello World</h1>
  <h2>This is my Thymeleaf index page. This is my changed.</h2>
</div>
</body>
</html>
like image 279
Saurabh Kishore Srivastava Avatar asked Oct 19 '25 11:10

Saurabh Kishore Srivastava


1 Answers

There is complete support for thymleaf from intellj idea 14. Your missing part here is the use of namespace

<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-4.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org">

use this in your template then you will get the intellij completion . Hope this answer your question. Thanks

like image 110
Moshiour Avatar answered Oct 22 '25 03:10

Moshiour



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!