{"id":40289,"date":"2023-03-19T07:17:56","date_gmt":"2023-11-10T00:45:06","guid":{"rendered":"https:\/\/www.silicloud.com\/zh\/blog\/%e8%ae%a9spring-boot-1-4thymeleaf-3-0%e5%90%af%e7%94%a8spel%e7%bc%96%e8%af%91%e5%99%a8%e4%bb%a5%e6%8f%90%e9%ab%98%e6%80%a7%e8%83%bd%ef%bc%81\/"},"modified":"2024-04-29T19:32:52","modified_gmt":"2024-04-29T11:32:52","slug":"%e8%ae%a9spring-boot-1-4thymeleaf-3-0%e5%90%af%e7%94%a8spel%e7%bc%96%e8%af%91%e5%99%a8%e4%bb%a5%e6%8f%90%e9%ab%98%e6%80%a7%e8%83%bd%ef%bc%81","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/zh\/blog\/%e8%ae%a9spring-boot-1-4thymeleaf-3-0%e5%90%af%e7%94%a8spel%e7%bc%96%e8%af%91%e5%99%a8%e4%bb%a5%e6%8f%90%e9%ab%98%e6%80%a7%e8%83%bd%ef%bc%81\/","title":{"rendered":"\u8ba9Spring Boot 1.4+Thymeleaf 3.0\u542f\u7528SpEL\u7f16\u8bd1\u5668\u4ee5\u63d0\u9ad8\u6027\u80fd\uff01"},"content":{"rendered":"<p>\u5728\u4e4b\u524d\u7684\u5e16\u5b50\u4e2d\uff0c\u6211\u4ecb\u7ecd\u4e86\u5728Spring Boot 1.4\u4e2d\u4f7f\u7528Thymeleaf 3.0\u7cfb\u5217\u7684\u914d\u7f6e\u65b9\u6cd5\u3002\u4f46\u662f\uff0c\u4eceThymeleaf-Spring 3.0\u5f00\u59cb\uff0c\u6dfb\u52a0\u4e86\u542f\u7528SpEL\u7f16\u8bd1\u5668\u7684\u9009\u9879\uff0c\u901a\u8fc7\u542f\u7528SpEL\u7f16\u8bd1\u5668\u53ef\u4ee5\u63d0\u9ad8\u8bc4\u4f30\u6a21\u677f\u6587\u4ef6\u4e2d\u6307\u5b9a\u7684\u8868\u8fbe\u5f0f\u7684\u901f\u5ea6\u3002\u5728GitHub\u7684Issue\u4e2d\uff0c\u6709\u8bc4\u8bba\u6307\u51fa\u53ef\u4ee5\u83b7\u5f97\u7ea635\uff05\u7684\u6027\u80fd\u6539\u5584\u3002\uff08\u6211\u8ba4\u4e3a\u6539\u5584\u7a0b\u5ea6\u53d6\u51b3\u4e8e\u8868\u8fbe\u5f0f\u7684\u6570\u91cf\u548c\u4f7f\u7528\u65b9\u5f0f&#8230;\uff09<\/p>\n<h1>\u9a8c\u8bc1\u7248\u672c<\/h1>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">Spring Boot 1.4.1.RELEASE<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">Thymeleaf 3.0.2.RELEASE<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">Thymeleaf-Spring 3.0.2.RELEASE<\/ul>\n<h1>\u542f\u7528\u9009\u9879<\/h1>\n<p>\u5982\u679c\u60f3\u8981\u542f\u7528\u9009\u9879\uff0c\u8bf7\u5728Java Config\u7c7b\u5185\u51c6\u5907\u4e00\u4e2a\u65b9\u6cd5\u6765\u6ce8\u5165SpringTemplateEngine\uff0c\u5e76\u5c06\u6ce8\u5165\u7684SpringTemplateEngine\u7684setEnableSpringELCompiler\u65b9\u6cd5\u4f20\u5165true\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"nd\">@Configuration<\/span>\r\n<span class=\"kd\">public<\/span> <span class=\"kd\">class<\/span> <span class=\"nc\">WebMvcConfig<\/span> <span class=\"kd\">extends<\/span> <span class=\"nc\">WebMvcConfigurerAdapter<\/span> <span class=\"o\">{<\/span>\r\n\r\n    <span class=\"c1\">\/\/ ...<\/span>\r\n\r\n    <span class=\"nd\">@Autowired<\/span>\r\n    <span class=\"kt\">void<\/span> <span class=\"nf\">configureThymeleafSpringTemplateEngine<\/span><span class=\"o\">(<\/span><span class=\"nc\">SpringTemplateEngine<\/span> <span class=\"n\">templateEngine<\/span><span class=\"o\">)<\/span> <span class=\"o\">{<\/span>\r\n        <span class=\"n\">templateEngine<\/span><span class=\"o\">.<\/span><span class=\"na\">setEnableSpringELCompiler<\/span><span class=\"o\">(<\/span><span class=\"kc\">true<\/span><span class=\"o\">);<\/span> <span class=\"c1\">\/\/ true\u3092\u6307\u5b9a\uff01\uff01<\/span>\r\n    <span class=\"o\">}<\/span>\r\n\r\n<span class=\"o\">}<\/span>\r\n<\/code><\/pre>\n<h1>\u603b\u7ed3<\/h1>\n<p>\u867d\u7136\u6211\u6ca1\u6709\u8bc4\u4f30\u8fc7\u6027\u80fd\u662f\u5426\u6709\u6240\u6539\u8fdb\uff0c\u4e5f\u65e0\u6cd5\u4ece\u611f\u89c9\u4e0a\u5224\u65ad\uff0c\u4f46\u662f\u6211\u786e\u8ba4\u901a\u8fc7\u4f7f\u7528\u8c03\u8bd5\u5668\uff0cSpEL\u7684\u7f16\u8bd1\u5668\u5df2\u7ecf\u542f\u7528\u4e86\u3002\u5728\u5f53\u524d\u7684Spring Boot\u7248\u672c\u4e2d\uff0c\u65e0\u6cd5\u4f7f\u7528\u5c5e\u6027\u8fdb\u884c\u81ea\u5b9a\u4e49\uff0c\u4f46\u662f\u5f53Spring Boot\u5904\u7406Thymeleaf\u7684\u9ed8\u8ba4\u7248\u672c\u53d8\u4e3a3.0\u7cfb\u5217\u65f6\uff0c\u6211\u60f3\u5c1d\u8bd5\u4f7f\u7528\u5c5e\u6027\u8fdb\u884c\u81ea\u5b9a\u4e49\uff08\u6211\u8fd8\u89c9\u5f97Spring Boot\u7684\u5f00\u53d1\u4eba\u5458\u53ef\u80fd\u4f1a\u63d0\u4f9b\u652f\u6301\uff09\u3002<\/p>\n<h1>\u53c2\u8003\u7f51\u7ad9<\/h1>\n<ul class=\"post-ul\">http:\/\/www.thymeleaf.org\/doc\/articles\/thymeleaf3migration.html#performance-improvements<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u5728\u4e4b\u524d\u7684\u5e16\u5b50\u4e2d\uff0c\u6211\u4ecb\u7ecd\u4e86\u5728Spring Boot 1.4\u4e2d\u4f7f\u7528Thymeleaf 3.0\u7cfb\u5217\u7684\u914d\u7f6e\u65b9\u6cd5\u3002\u4f46\u662f\uff0c [&hellip;]<\/p>\n","protected":false},"author":8,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-40289","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.5 (Yoast SEO v21.5) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u8ba9Spring Boot 1.4+Thymeleaf 3.0\u542f\u7528SpEL\u7f16\u8bd1\u5668\u4ee5\u63d0\u9ad8\u6027\u80fd\uff01 - Blog - Silicon Cloud<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.silicloud.com\/zh\/blog\/\u8ba9spring-boot-1-4thymeleaf-3-0\u542f\u7528spel\u7f16\u8bd1\u5668\u4ee5\u63d0\u9ad8\u6027\u80fd\uff01\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u8ba9Spring Boot 1.4+Thymeleaf 3.0\u542f\u7528SpEL\u7f16\u8bd1\u5668\u4ee5\u63d0\u9ad8\u6027\u80fd\uff01\" \/>\n<meta property=\"og:description\" content=\"\u5728\u4e4b\u524d\u7684\u5e16\u5b50\u4e2d\uff0c\u6211\u4ecb\u7ecd\u4e86\u5728Spring Boot 1.4\u4e2d\u4f7f\u7528Thymeleaf 3.0\u7cfb\u5217\u7684\u914d\u7f6e\u65b9\u6cd5\u3002\u4f46\u662f\uff0c [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.silicloud.com\/zh\/blog\/\u8ba9spring-boot-1-4thymeleaf-3-0\u542f\u7528spel\u7f16\u8bd1\u5668\u4ee5\u63d0\u9ad8\u6027\u80fd\uff01\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:published_time\" content=\"2023-11-10T00:45:06+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-04-29T11:32:52+00:00\" \/>\n<meta name=\"author\" content=\"\u96c5, \u609f\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u96c5, \u609f\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e8%ae%a9spring-boot-1-4thymeleaf-3-0%e5%90%af%e7%94%a8spel%e7%bc%96%e8%af%91%e5%99%a8%e4%bb%a5%e6%8f%90%e9%ab%98%e6%80%a7%e8%83%bd%ef%bc%81\/\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e8%ae%a9spring-boot-1-4thymeleaf-3-0%e5%90%af%e7%94%a8spel%e7%bc%96%e8%af%91%e5%99%a8%e4%bb%a5%e6%8f%90%e9%ab%98%e6%80%a7%e8%83%bd%ef%bc%81\/\",\"name\":\"\u8ba9Spring Boot 1.4+Thymeleaf 3.0\u542f\u7528SpEL\u7f16\u8bd1\u5668\u4ee5\u63d0\u9ad8\u6027\u80fd\uff01 - Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\"},\"datePublished\":\"2023-11-10T00:45:06+00:00\",\"dateModified\":\"2024-04-29T11:32:52+00:00\",\"author\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/f044a4b7fa4ee2701702942002419ca6\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e8%ae%a9spring-boot-1-4thymeleaf-3-0%e5%90%af%e7%94%a8spel%e7%bc%96%e8%af%91%e5%99%a8%e4%bb%a5%e6%8f%90%e9%ab%98%e6%80%a7%e8%83%bd%ef%bc%81\/#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/zh\/blog\/%e8%ae%a9spring-boot-1-4thymeleaf-3-0%e5%90%af%e7%94%a8spel%e7%bc%96%e8%af%91%e5%99%a8%e4%bb%a5%e6%8f%90%e9%ab%98%e6%80%a7%e8%83%bd%ef%bc%81\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e8%ae%a9spring-boot-1-4thymeleaf-3-0%e5%90%af%e7%94%a8spel%e7%bc%96%e8%af%91%e5%99%a8%e4%bb%a5%e6%8f%90%e9%ab%98%e6%80%a7%e8%83%bd%ef%bc%81\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.silicloud.com\/zh\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u8ba9Spring Boot 1.4+Thymeleaf 3.0\u542f\u7528SpEL\u7f16\u8bd1\u5668\u4ee5\u63d0\u9ad8\u6027\u80fd\uff01\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/\",\"name\":\"Blog - Silicon Cloud\",\"description\":\"\",\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/f044a4b7fa4ee2701702942002419ca6\",\"name\":\"\u96c5, \u609f\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/e71a913e914f1aad1efc391f92084294bac54bc782acd289638580134cf667a6?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/e71a913e914f1aad1efc391f92084294bac54bc782acd289638580134cf667a6?s=96&d=mm&r=g\",\"caption\":\"\u96c5, \u609f\"},\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/author\/yawu\/\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e8%ae%a9spring-boot-1-4thymeleaf-3-0%e5%90%af%e7%94%a8spel%e7%bc%96%e8%af%91%e5%99%a8%e4%bb%a5%e6%8f%90%e9%ab%98%e6%80%a7%e8%83%bd%ef%bc%81\/#local-main-organization-logo\",\"url\":\"\",\"contentUrl\":\"\",\"caption\":\"Blog - Silicon Cloud\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"\u8ba9Spring Boot 1.4+Thymeleaf 3.0\u542f\u7528SpEL\u7f16\u8bd1\u5668\u4ee5\u63d0\u9ad8\u6027\u80fd\uff01 - Blog - Silicon Cloud","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.silicloud.com\/zh\/blog\/\u8ba9spring-boot-1-4thymeleaf-3-0\u542f\u7528spel\u7f16\u8bd1\u5668\u4ee5\u63d0\u9ad8\u6027\u80fd\uff01\/","og_locale":"zh_CN","og_type":"article","og_title":"\u8ba9Spring Boot 1.4+Thymeleaf 3.0\u542f\u7528SpEL\u7f16\u8bd1\u5668\u4ee5\u63d0\u9ad8\u6027\u80fd\uff01","og_description":"\u5728\u4e4b\u524d\u7684\u5e16\u5b50\u4e2d\uff0c\u6211\u4ecb\u7ecd\u4e86\u5728Spring Boot 1.4\u4e2d\u4f7f\u7528Thymeleaf 3.0\u7cfb\u5217\u7684\u914d\u7f6e\u65b9\u6cd5\u3002\u4f46\u662f\uff0c [&hellip;]","og_url":"https:\/\/www.silicloud.com\/zh\/blog\/\u8ba9spring-boot-1-4thymeleaf-3-0\u542f\u7528spel\u7f16\u8bd1\u5668\u4ee5\u63d0\u9ad8\u6027\u80fd\uff01\/","og_site_name":"Blog - Silicon Cloud","article_published_time":"2023-11-10T00:45:06+00:00","article_modified_time":"2024-04-29T11:32:52+00:00","author":"\u96c5, \u609f","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"\u96c5, \u609f"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e8%ae%a9spring-boot-1-4thymeleaf-3-0%e5%90%af%e7%94%a8spel%e7%bc%96%e8%af%91%e5%99%a8%e4%bb%a5%e6%8f%90%e9%ab%98%e6%80%a7%e8%83%bd%ef%bc%81\/","url":"https:\/\/www.silicloud.com\/zh\/blog\/%e8%ae%a9spring-boot-1-4thymeleaf-3-0%e5%90%af%e7%94%a8spel%e7%bc%96%e8%af%91%e5%99%a8%e4%bb%a5%e6%8f%90%e9%ab%98%e6%80%a7%e8%83%bd%ef%bc%81\/","name":"\u8ba9Spring Boot 1.4+Thymeleaf 3.0\u542f\u7528SpEL\u7f16\u8bd1\u5668\u4ee5\u63d0\u9ad8\u6027\u80fd\uff01 - Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website"},"datePublished":"2023-11-10T00:45:06+00:00","dateModified":"2024-04-29T11:32:52+00:00","author":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/f044a4b7fa4ee2701702942002419ca6"},"breadcrumb":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e8%ae%a9spring-boot-1-4thymeleaf-3-0%e5%90%af%e7%94%a8spel%e7%bc%96%e8%af%91%e5%99%a8%e4%bb%a5%e6%8f%90%e9%ab%98%e6%80%a7%e8%83%bd%ef%bc%81\/#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/zh\/blog\/%e8%ae%a9spring-boot-1-4thymeleaf-3-0%e5%90%af%e7%94%a8spel%e7%bc%96%e8%af%91%e5%99%a8%e4%bb%a5%e6%8f%90%e9%ab%98%e6%80%a7%e8%83%bd%ef%bc%81\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e8%ae%a9spring-boot-1-4thymeleaf-3-0%e5%90%af%e7%94%a8spel%e7%bc%96%e8%af%91%e5%99%a8%e4%bb%a5%e6%8f%90%e9%ab%98%e6%80%a7%e8%83%bd%ef%bc%81\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.silicloud.com\/zh\/blog\/"},{"@type":"ListItem","position":2,"name":"\u8ba9Spring Boot 1.4+Thymeleaf 3.0\u542f\u7528SpEL\u7f16\u8bd1\u5668\u4ee5\u63d0\u9ad8\u6027\u80fd\uff01"}]},{"@type":"WebSite","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website","url":"https:\/\/www.silicloud.com\/zh\/blog\/","name":"Blog - Silicon Cloud","description":"","inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/f044a4b7fa4ee2701702942002419ca6","name":"\u96c5, \u609f","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/e71a913e914f1aad1efc391f92084294bac54bc782acd289638580134cf667a6?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/e71a913e914f1aad1efc391f92084294bac54bc782acd289638580134cf667a6?s=96&d=mm&r=g","caption":"\u96c5, \u609f"},"url":"https:\/\/www.silicloud.com\/zh\/blog\/author\/yawu\/"},{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e8%ae%a9spring-boot-1-4thymeleaf-3-0%e5%90%af%e7%94%a8spel%e7%bc%96%e8%af%91%e5%99%a8%e4%bb%a5%e6%8f%90%e9%ab%98%e6%80%a7%e8%83%bd%ef%bc%81\/#local-main-organization-logo","url":"","contentUrl":"","caption":"Blog - Silicon Cloud"}]}},"_links":{"self":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/40289","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/comments?post=40289"}],"version-history":[{"count":2,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/40289\/revisions"}],"predecessor-version":[{"id":87213,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/40289\/revisions\/87213"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/media?parent=40289"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/categories?post=40289"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/tags?post=40289"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}