Karate用户咨询:日志频繁出现Thymeleaf警告是否需提交GitHub Issue?
关于Karate日志中频繁出现Thymeleaf警告的问题解答
其他Karate用户确实会碰到这类Thymeleaf警告,尤其是在生成测试报告的场景下。完全有必要在GitHub提交相关Issue,理由如下:
- 重复的警告信息会严重干扰日志排查,增加筛选有效内容的工作量
- 警告明确提示这些语法会在Thymeleaf未来版本中移除,若官方不及时更新内置模板,后续Karate升级依赖后可能出现模板渲染失败等问题
- 这是所有使用Karate的用户都会遇到的共性问题,提交Issue能推动官方统一修复,避免大家各自处理
警告核心问题梳理
这些警告指向Karate内置的karate-feature.html模板存在两处废弃用法:
- 未包装的片段表达式:比如
"karate-posthog.html"这类写法,需替换为标准语法~{karate-posthog.html} - 废弃的
th:include属性:需改用th:insert属性替代
原始警告日志
10:45:44.828 [pool-2-thread-1] WARN o.t.s.p.AbstractStandardFragmentInsertionTagProcessor - [THYMELEAF][pool-2-thread-1][karate-feature.html] Deprecated unwrapped fragment expression "karate-posthog.html" found in template karate-feature.html, line 15, col 15. Please use the complete syntax of fragment expressions instead ("~{karate-posthog.html}"). The old, unwrapped syntax for fragment expressions will be removed in future versions of Thymeleaf. 10:45:44.832 [pool-2-thread-1] WARN o.t.s.p.AbstractStandardFragmentInsertionTagProcessor - [THYMELEAF][pool-2-thread-1][karate-feature.html] Deprecated unwrapped fragment expression "karate-leftnav.html" found in template karate-feature.html, line 31, col 14. Please use the complete syntax of fragment expressions instead ("~{karate-leftnav.html}"). The old, unwrapped syntax for fragment expressions will be removed in future versions of Thymeleaf. 10:45:44.836 [pool-2-thread-1] WARN o.t.s.p.StandardIncludeTagProcessor - [THYMELEAF][pool-2-thread-1][karate-feature.html] Deprecated attribute {th:include,data-th-include} found in template karate-feature.html, line 74, col 16. Please use {th:insert,data-th-insert} instead, this deprecated attribute will be removed in future versions of Thymeleaf. 10:45:44.837 [pool-2-thread-1] WARN o.t.s.p.AbstractStandardFragmentInsertionTagProcessor - [THYMELEAF][pool-2-thread-1][karate-feature.html] Deprecated unwrapped fragment expression "karate-step.html" found in template karate-feature.html, line 74, col 16. Please use the complete syntax of fragment expressions instead ("~{karate-step.html}"). The old, unwrapped syntax for fragment expressions will be removed in future versions of Thymeleaf. 10:45:44.869 [pool-2-thread-1] WARN o.t.s.p.StandardIncludeTagProcessor - [THYMELEAF][pool-2-thread-1][karate-feature.html] Deprecated attribute {th:include,data-th-include} found in template karate-feature.html, line 74, col 16. Please use {th:insert,data-th-insert} instead, this deprecated attribute will be removed in future versions of Thymeleaf. 10:45:44.869 [pool-2-thread-1] WARN o.t.s.p.AbstractStandardFragmentInsertionTagProcessor - [THYMELEAF][pool-2-thread-1][karate-feature.html] Deprecated unwrapped fragment expression "karate-step.html" found in template karate-feature.html, line 74, col 16. Please use the complete syntax of fragment expressions instead ("~{karate-step.html}"). The old, unwrapped syntax for fragment expressions will be removed in future versions of Thymeleaf. 10:45:44.890 [pool-2-thread-1] WARN o.t.s.p.StandardIncludeTagProcessor - [THYMELEAF][pool-2-thread-1][karate-feature.html] Deprecated attribute {th:include,data-th-include} found in template karate-feature.html, line 74, col 16. Please use {th:insert,data-th-insert} instead, this deprecated attribute will be removed in future versions of Thymeleaf. 10:45:44.890 [pool-2-thread-1] WARN o.t.s.p.AbstractStandardFragmentInsertionTagProcessor - [THYMELEAF][pool-2-thread-1][karate-feature.html] Deprecated unwrapped fragment expression "karate-step.html" found in template karate-feature.html, line 74, col 16. Please use the complete syntax of fragment expressions instead ("~{karate-step.html}"). The old, unwrapped syntax for fragment expressions will be removed in future versions of Thymeleaf. 10:45:44.914 [pool-2-thread-1] WARN o.t.s.p.StandardIncludeTagProcessor - [THYMELEAF][pool-2-thread-1][karate-feature.html] Deprecated attribute {th:include,data-th-include} found in template karate-feature.html, line 74, col 16. Please use {th:insert,data-th-insert} instead, this deprecated attribute will be removed in future versions of Thymeleaf. 10:45:44.914 [pool-2-thread-1] WARN o.t.s.p.AbstractStandardFragmentInsertionTagProcessor - [THYMELEAF][pool-2-thread-1][karate-feature.html] Deprecated unwrapped fragment expression "karate-step.html" found in template karate-feature.html, line 74, col 16. Please use the complete syntax of fragment expressions instead ("~{karate-step.html}"). The old, unwrapped syntax for fragment expressions will be removed in future versions of Thymeleaf.
内容的提问来源于stack exchange,提问作者j8d
相关产品推荐
相关产品推荐

