{"id":64106,"date":"2025-05-03T16:49:10","date_gmt":"2025-05-03T08:49:10","guid":{"rendered":"https:\/\/fwq.ai\/blog\/64106\/"},"modified":"2025-05-03T16:49:10","modified_gmt":"2025-05-03T08:49:10","slug":"spring-boot-%e5%b0%8f-demo-%e4%b8%ad%e5%87%ba%e7%8e%b0-error-resolving-template-%e9%94%99%e8%af%af%ef%bc%9a%e5%a6%82%e4%bd%95%e8%a7%a3%e5%86%b3-thymeleaf-%e6%a8%a1%e6%9d%bf%e5%bc%95-3","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/64106\/","title":{"rendered":"Spring Boot \u5c0f demo \u4e2d\u51fa\u73b0 \u201cError resolving template\u201d \u9519\u8bef\uff1a\u5982\u4f55\u89e3\u51b3 Thymeleaf \u6a21\u677f\u5f15\u64ce\u65e0\u6cd5\u627e\u5230\u6216\u8bbf\u95ee\u6a21\u677f\uff1f"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173052576493796.jpg\" class=\"aligncenter\" title=\"Spring Boot \u5c0f demo \u4e2d\u51fa\u73b0 \u201cError resolving template\u201d \u9519\u8bef\uff1a\u5982\u4f55\u89e3\u51b3 Thymeleaf \u6a21\u677f\u5f15\u64ce\u65e0\u6cd5\u627e\u5230\u6216\u8bbf\u95ee\u6a21\u677f\uff1f\u63d2\u56fe\" alt=\"Spring Boot \u5c0f demo \u4e2d\u51fa\u73b0 \u201cError resolving template\u201d \u9519\u8bef\uff1a\u5982\u4f55\u89e3\u51b3 Thymeleaf \u6a21\u677f\u5f15\u64ce\u65e0\u6cd5\u627e\u5230\u6216\u8bbf\u95ee\u6a21\u677f\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>spring boot \u5c0f demo \u51fa\u73b0 error resolving template \u9519\u8bef<\/strong><\/p>\n<p><strong>\u95ee\u9898\u63cf\u8ff0<\/strong><\/p>\n<p>\u4f5c\u8005\u5728\u6784\u5efa spring boot \u5c0f demo \u65f6\u9047\u5230\u9519\u8bef error resolving template [], template might not exist or might not be ible by any of the configured template resolvers\u3002<\/p>\n<p><strong>\u95ee\u9898\u5206\u6790<\/strong><\/p>\n<p>\u8be5\u9519\u8bef\u8868\u660e thymeleaf \u6a21\u677f\u5f15\u64ce\u65e0\u6cd5\u627e\u5230\u6216\u8bbf\u95ee\u6307\u5b9a\u6a21\u677f\u3002<\/p>\n<p><strong>\u89e3\u51b3\u65b9\u6848<\/strong><\/p>\n<p>\u8981\u89e3\u51b3\u6b64\u95ee\u9898\uff0c\u9700\u8981\u786e\u8ba4\u4ee5\u4e0b\u51e0\u70b9\uff1a<\/p>\n<ol>\n<li>pom \u6587\u4ef6\u4e2d\u5df2\u5f15\u5165 spring boot \u7684 thymeleaf \u8d77\u59cb\u5668\uff1a<\/li>\n<\/ol>\n<pre>&lt;dependency&gt;\n    &lt;groupid&gt;org.springframework.boot&lt;\/groupid&gt;\n    &lt;artifactid&gt;spring-boot-starter-thymeleaf&lt;\/artifactid&gt;\n&lt;\/dependency&gt;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<ol>\n<li>application.properties \u6587\u4ef6\u4e2d\u5df2\u914d\u7f6e thymeleaf \u89c6\u56fe\u89e3\u6790\u5668\uff1a<\/li>\n<\/ol>\n<pre>spring.thymeleaf.mode=HTML5\nspring.thymeleaf.cache=false<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<ol>\n<li>\u786e\u4fdd jsp \u6587\u4ef6\u6216\u5176\u4ed6\u6a21\u677f\u6587\u4ef6\u5b58\u5728\u4e8e\u6b63\u786e\u7684\u4f4d\u7f6e\uff0c\u5e76\u5728 templates \u76ee\u5f55\u4e0b\u3002<\/li>\n<\/ol>\n<p><strong>\u4ee3\u7801\u4fee\u6b63<\/strong><\/p>\n<p>\u4f5c\u8005\u6ca1\u6709\u63d0\u4f9b\u5b8c\u6574\u7684\u4ee3\u7801\uff0c\u56e0\u6b64\u65e0\u6cd5\u63d0\u4f9b\u5177\u4f53\u5efa\u8bae\u3002\u4f46\u662f\uff0c\u53ef\u4ee5\u6839\u636e\u4e0a\u8ff0\u68c0\u67e5\u70b9\uff0c\u68c0\u67e5\u81ea\u5df1\u7684\u4ee3\u7801\u5e76\u8fdb\u884c\u5fc5\u8981\u7684\u66f4\u6539\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662fSpring Boot \u5c0f demo \u4e2d\u51fa\u73b0 \u201cError resolving template\u201d \u9519\u8bef\uff1a\u5982\u4f55\u89e3\u51b3 Thymeleaf \u6a21\u677f\u5f15\u64ce\u65e0\u6cd5\u627e\u5230\u6216\u8bbf\u95ee\u6a21\u677f\uff1f\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8IDCBABY\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>spring boot \u5c0f demo \u51fa\u73b0 error resolving template \u9519\u8bef \u95ee\u9898\u63cf\u8ff0 \u4f5c\u8005\u5728\u6784\u5efa spring boot \u5c0f demo \u65f6\u9047\u5230\u9519\u8bef error resolving template [], template might not exist or might not be ible by any of the configured template resolvers\u3002 \u95ee\u9898\u5206\u6790 \u8be5\u9519\u8bef\u8868\u660e thymeleaf \u6a21\u677f\u5f15\u64ce\u65e0\u6cd5\u627e\u5230\u6216\u8bbf\u95ee\u6307\u5b9a\u6a21\u677f\u3002 \u89e3\u51b3\u65b9\u6848 \u8981\u89e3\u51b3\u6b64\u95ee\u9898\uff0c\u9700\u8981\u786e\u8ba4\u4ee5\u4e0b\u51e0\u70b9\uff1a pom \u6587\u4ef6\u4e2d\u5df2\u5f15\u5165 spring boot \u7684 thymeleaf \u8d77\u59cb\u5668\uff1a &lt;dependency&gt; &lt;groupid&gt;org.springframework.boot&lt;\/groupid&gt; &lt;artifactid&gt;spring-boot-starter-thymeleaf&lt;\/artifactid&gt; &lt;\/dependency&gt; \u767b\u5f55\u540e\u590d\u5236 application.properties [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-64106","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/64106","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=64106"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/64106\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=64106"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=64106"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=64106"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}