thymeleaf 内容辅助不起作用,当我在 HTML 文件中键入 th: 前缀时,仅显示 th:block 提案。
<th:block
我曾尝试将 Thymeleaf 处理器提案提升到 HTML 文件的 STS/elipse 设置的顶部,但没有成功。
项目是Spring Boot + Thymeleaf,Gradle代码片段:
plugins {
id 'org.springframework.boot' version '2.1.4.RELEASE'
id 'java'
}
apply plugin: 'io.spring.dependency-management'
repositories {
mavenCentral()
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation "org.springframework.boot:spring-boot-starter-thymeleaf"
implementation "org.springframework.boot:spring-boot-devtools"
}
我添加了 html 命名空间:
<html xmlns:th="http://www.thymeleaf.org">
将第 th 个命名空间更改为另一个不起作用;
好吧,唯一的工作时间是 th 只是替换 HTML th posotion...
<table>
<tbody>
<tr th:
最佳答案
我在执行以下步骤时遇到了同样的问题。
打开工作区.metadata下的.log文件
打开 Thymeleaf 模板 (html):按 Ctrl+sapce
检查 .log 文件中的异常 在我的例子中,这是 groovy 运行时异常,所以我卸载并安装了 groovy 插件 重启 eclipse,thymeleaf content assistant 开始工作。
[ groovy.lang.GroovyRuntimeException:找不到匹配的构造函数:org.thymeleaf.extras.eclipse.contentassist.autocomplete.proposals.AttributeProcessorCompletionProposal(org.thymeleaf.extras.eclipse.dialect.xml.ElementProcessor,整数,整数, boolean 值) ]
关于java - Thymeleaf 内容助手无法与 Spring Boot 一起使用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55879751/