{"id":167,"date":"2019-06-20T02:20:13","date_gmt":"2019-06-20T02:20:13","guid":{"rendered":"https:\/\/www.kindsonthegenius.com\/spring-boot\/?p=167"},"modified":"2019-06-20T02:20:13","modified_gmt":"2019-06-20T02:20:13","slug":"spring-boot-introduction-to-thymeleaf","status":"publish","type":"post","link":"https:\/\/www.kindsonthegenius.com\/spring-boot\/spring-boot-introduction-to-thymeleaf\/","title":{"rendered":"Spring Boot &#8211; Introduction to Thymeleaf"},"content":{"rendered":"<p>In this lesson, I would teach you how to display date in html form. We would use Thymeleaf to achieve this.<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Overview of Thymeleaf<\/strong><\/p>\n<p>According to the <a href=\"https:\/\/www.thymeleaf.org\/\">Thymeleaf website<\/a>, &#8220;Thymeleaf is a modern server-side Java template engine for both web and standalone environment&#8221;. Thymeleaf is capable of processing JavaScript, HTML, XML, CSS and plain text.<\/p>\n<p>Before now, we use jsp (Java Server Pages) to process dynamic content. I would not spend time on why Thymeleaf is better than jsp. But we can be sure that Thymeleaf is easier to work with and likely would completely replace jsp.<\/p>\n<p>So let&#8217;s get started!<\/p>\n<p>&nbsp;<\/p>\n<p><strong>In this Tutorial&#8230;<\/strong><\/p>\n<p>First we are going to display all our entities in form (like a list).<\/p>\n<p>Next, we would add a data entry form for each of the entities.<\/p>\n<p>Finally we would add feature for Update and Delete of records<\/p>\n<p>Further in the tutorial, we would implement a login form using Spring Security.<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Add Thymeleaf and other dependencies<\/strong><\/p>\n<p>Add the following Thymeleaf dependency to your pom.xml file<br \/>\n<!-- HTML generated using hilite.me --><\/p>\n<p>&nbsp;<\/p>\n<pre style=\"margin: 0; line-height: 125%;\"><span style=\"color: #007700;\">&lt;dependency&gt;<\/span>      \r\n   <span style=\"color: #007700;\">&lt;groupId&gt;<\/span>org.springframework.boot<span style=\"color: #007700;\">&lt;\/groupId&gt;<\/span>\r\n   <span style=\"color: #007700;\">&lt;artifactId&gt;<\/span>spring-boot-starter-thymeleaf<span style=\"color: #007700;\">&lt;\/artifactId&gt;<\/span>\r\n<span style=\"color: #007700;\">&lt;\/dependency&gt;<\/span>\r\n\r\n<span style=\"color: #007700;\">&lt;dependency&gt;<\/span>\r\n   <span style=\"color: #007700;\">&lt;groupId&gt;<\/span>org.springframework<span style=\"color: #007700;\">&lt;\/groupId&gt;<\/span>\r\n   <span style=\"color: #007700;\">&lt;artifactId&gt;<\/span>spring-context<span style=\"color: #007700;\">&lt;\/artifactId&gt;<\/span>\r\n<span style=\"color: #007700;\">&lt;\/dependency&gt;<\/span>\r\n    \r\n<span style=\"color: #007700;\">&lt;dependency&gt;<\/span>\r\n  <span style=\"color: #007700;\">&lt;groupId&gt;<\/span>org.springframework<span style=\"color: #007700;\">&lt;\/groupId&gt;<\/span>\r\n  <span style=\"color: #007700;\">&lt;artifactId&gt;<\/span>spring-web<span style=\"color: #007700;\">&lt;\/artifactId&gt;<\/span>\r\n<span style=\"color: #007700;\">&lt;\/dependency&gt;<\/span>\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p>Save the file so the dependencies are downloaded to the classpath<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Set up the Home Page<\/strong><\/p>\n<p>Create an index.html file inside the templates folder in the src\/main\/resources folder<\/p>\n<p>The content of the file would be as shown below:<\/p>\n<p>&nbsp;<\/p>\n<pre style=\"margin: 0; line-height: 125%;\"><span style=\"color: #557799;\">&lt;!DOCTYPE html&gt;<\/span>\r\n<span style=\"color: #007700;\">&lt;html&gt;<\/span>\r\n<span style=\"color: #007700;\">&lt;head&gt;<\/span>\r\n<span style=\"color: #007700;\">&lt;meta<\/span> <span style=\"color: #0000cc;\">charset=<\/span><span style=\"background-color: #fff0f0;\">\"ISO-8859-1\"<\/span><span style=\"color: #007700;\">&gt;<\/span>\r\n<span style=\"color: #007700;\">&lt;title&gt;<\/span>Thymeleaf Tutorial<span style=\"color: #007700;\">&lt;\/title&gt;<\/span>\r\n<span style=\"color: #007700;\">&lt;\/head&gt;<\/span>\r\n<span style=\"color: #007700;\">&lt;body&gt;<\/span>\r\n\r\n<span style=\"color: #007700;\">&lt;h2&gt;<\/span>Welcome to Thymeleaf!<span style=\"color: #007700;\">&lt;\/h2&gt;<\/span>\r\n\r\n<span style=\"color: #007700;\">&lt;\/body&gt;<\/span>\r\n<span style=\"color: #007700;\">&lt;\/html&gt;<\/span>\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p>Create a file called HomeController inside the <strong>com.kindsonthegenius.social<\/strong> package.<\/p>\n<p>Annotate the class with @Controller directive<\/p>\n<p>Write a method inside this file to return the index page you created.<\/p>\n<p>The content of the HomeController file would be as shown below.<\/p>\n<p><!-- HTML generated using hilite.me --><\/p>\n<pre style=\"margin: 0; line-height: 125%;\"><span style=\"color: #555555; font-weight: bold;\">@Controller<\/span>\r\n<span style=\"color: #008800; font-weight: bold;\">public<\/span> <span style=\"color: #008800; font-weight: bold;\">class<\/span> <span style=\"color: #bb0066; font-weight: bold;\">HomeController<\/span> <span style=\"color: #333333;\">{<\/span>\r\n\t\r\n\t<span style=\"color: #555555; font-weight: bold;\">@RequestMapping<\/span><span style=\"color: #333333;\">(<\/span>value<span style=\"color: #333333;\">=<\/span><span style=\"background-color: #fff0f0;\">\"\/home\"<\/span><span style=\"color: #333333;\">)<\/span>\r\n\t<span style=\"color: #008800; font-weight: bold;\">public<\/span> <span style=\"color: #008800; font-weight: bold;\">static<\/span> String <span style=\"color: #0066bb; font-weight: bold;\">welcome<\/span><span style=\"color: #333333;\">()<\/span> <span style=\"color: #333333;\">{<\/span>\r\n\t\t<span style=\"color: #008800; font-weight: bold;\">return<\/span> <span style=\"background-color: #fff0f0;\">\"index\"<\/span><span style=\"color: #333333;\">;<\/span>\r\n\t<span style=\"color: #333333;\">}<\/span>\t\r\n<span style=\"color: #333333;\">}<\/span>\r\n<\/pre>\n<p>Save the file and launch the application<\/p>\n<p>Visit http:\/\/localhost:8080 and confirm that the page displays\u00a0 as shown below.<\/p>\n<p><a href=\"https:\/\/www.kindsonthegenius.com\/spring-boot\/wp-content\/uploads\/sites\/7\/2019\/06\/Thymeleaf.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-168 \" src=\"https:\/\/www.kindsonthegenius.com\/spring-boot\/wp-content\/uploads\/sites\/7\/2019\/06\/Thymeleaf.jpg\" alt=\"Thymeleaf\" width=\"467\" height=\"230\" srcset=\"https:\/\/www.kindsonthegenius.com\/spring-boot\/wp-content\/uploads\/sites\/7\/2019\/06\/Thymeleaf.jpg 770w, https:\/\/www.kindsonthegenius.com\/spring-boot\/wp-content\/uploads\/sites\/7\/2019\/06\/Thymeleaf-300x148.jpg 300w, https:\/\/www.kindsonthegenius.com\/spring-boot\/wp-content\/uploads\/sites\/7\/2019\/06\/Thymeleaf-768x378.jpg 768w\" sizes=\"auto, (max-width: 467px) 100vw, 467px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>Add a navigation bar. This you do by modifying the index.html file as shown below. Just add the code below in the &lt;body&gt; &lt;\/body&gt; section<\/p>\n<p>&nbsp;<\/p>\n<pre style=\"margin: 0; line-height: 125%;\"><span style=\"color: #007700;\">&lt;div<\/span> <span style=\"color: #0000cc;\">align=<\/span><span style=\"background-color: #fff0f0;\">\"center\"<\/span><span style=\"color: #007700;\">&gt;<\/span> \r\n\r\n<span style=\"color: #007700;\">&lt;a<\/span> <span style=\"color: #0000cc;\">th:href=<\/span><span style=\"background-color: #fff0f0;\">\"@{posts}\"<\/span><span style=\"color: #007700;\">&gt;<\/span>Posts<span style=\"color: #007700;\">&lt;\/a&gt;<\/span> | \r\n<span style=\"color: #007700;\">&lt;a<\/span> <span style=\"color: #0000cc;\">th:href=<\/span><span style=\"background-color: #fff0f0;\">\"@{students}\"<\/span><span style=\"color: #007700;\">&gt;<\/span>Students<span style=\"color: #007700;\">&lt;\/a&gt;<\/span> | \r\n<span style=\"color: #007700;\">&lt;a<\/span> <span style=\"color: #0000cc;\">th:href=<\/span><span style=\"background-color: #fff0f0;\">\"@{users}\"<\/span><span style=\"color: #007700;\">&gt;<\/span>Users<span style=\"color: #007700;\">&lt;\/a&gt;<\/span>Users | \r\n<span style=\"color: #007700;\">&lt;a<\/span> <span style=\"color: #0000cc;\">th:href=<\/span><span style=\"background-color: #fff0f0;\">\"@{locations}\"<\/span><span style=\"color: #007700;\">&gt;<\/span>Locations<span style=\"color: #007700;\">&lt;\/a&gt;<\/span> \r\n\r\n<span style=\"color: #007700;\">&lt;\/div&gt;<\/span>\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p>Now, create four more html pages. Name them posts.html, students.html, users.html and location.html.<\/p>\n<p>Next, Copy across the content of index.html file into these pages.<\/p>\n<p>&nbsp;<\/p>\n<p>We would start by working on the LocationController file. We would make the controller send a list of locations to the locations.html file.<\/p>\n<p>Open the LocationController file. Change the @RequestController annotation to @Controller<\/p>\n<p>Modify the getAllLocations function to the one below:<\/p>\n<p>&nbsp;<\/p>\n<p><!-- HTML generated using hilite.me --><\/p>\n<pre style=\"margin: 0; line-height: 125%;\"> <span style=\"color: #555555; font-weight: bold;\">@RequestMapping<\/span><span style=\"color: #333333;\">(<\/span>value <span style=\"color: #333333;\">=<\/span> <span style=\"background-color: #fff0f0;\">\"\/locations\"<\/span><span style=\"color: #333333;\">)<\/span>\r\n <span style=\"color: #008800; font-weight: bold;\">public<\/span> String <span style=\"color: #0066bb; font-weight: bold;\">getAllLocations<\/span><span style=\"color: #333333;\">(<\/span>Model model<span style=\"color: #333333;\">)<\/span> \r\n <span style=\"color: #333333;\">{<\/span>\t\t\t\t\r\n\tmodel<span style=\"color: #333333;\">.<\/span><span style=\"color: #0000cc;\">addAttribute<\/span><span style=\"color: #333333;\">(<\/span><span style=\"background-color: #fff0f0;\">\"locations\"<\/span><span style=\"color: #333333;\">,<\/span> locationService<span style=\"color: #333333;\">.<\/span><span style=\"color: #0000cc;\">getAllLocations<\/span><span style=\"color: #333333;\">());<\/span>\t\t\r\n\t<span style=\"color: #008800; font-weight: bold;\">return<\/span> <span style=\"background-color: #fff0f0;\">\"locations\"<\/span><span style=\"color: #333333;\">;<\/span>\t\t\r\n <span style=\"color: #333333;\">}<\/span>\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p>Finally, add the code below to the locations.html file.<\/p>\n<p>&nbsp;<\/p>\n<p><!-- HTML generated using hilite.me --><\/p>\n<pre style=\"margin: 0; line-height: 125%;\"><span style=\"color: #007700;\">&lt;ul&gt;<\/span>\r\n    <span style=\"color: #007700;\">&lt;li<\/span> <span style=\"color: #0000cc;\">th:each=<\/span><span style=\"background-color: #fff0f0;\">\"location : ${locations}\"<\/span><span style=\"color: #007700;\">&gt;<\/span>\r\n        <span style=\"color: #007700;\">&lt;span<\/span> <span style=\"color: #0000cc;\">th:text=<\/span><span style=\"background-color: #fff0f0;\">\"${location.name}\"<\/span><span style=\"color: #007700;\">&gt;<\/span>Default<span style=\"color: #007700;\">&lt;\/span&gt;<\/span>\r\n    <span style=\"color: #007700;\">&lt;\/li&gt;<\/span>\r\n<span style=\"color: #007700;\">&lt;\/ul&gt;<\/span>\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p>Launch the application and visit http:\/\/localhost:8080.<\/p>\n<p>Navigate to Locations and notice that you have list of locations displayed as a bulleted list.<\/p>\n<p>If you have challenges, I would recommend you watch the video.<\/p>\n<p>In the next lesson, we would see how work on other entities but I try to do it yourself first.<\/p>\n<!-- AddThis Advanced Settings generic via filter on the_content --><!-- AddThis Share Buttons generic via filter on the_content -->","protected":false},"excerpt":{"rendered":"<p>In this lesson, I would teach you how to display date in html form. We would use Thymeleaf to achieve this. &nbsp; Overview of Thymeleaf &hellip; <!-- AddThis Advanced Settings generic via filter on get_the_excerpt --><!-- AddThis Share Buttons generic via filter on get_the_excerpt --><\/p>\n","protected":false},"author":1,"featured_media":169,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[2],"tags":[13],"class_list":["post-167","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-spring-boot-tutorials","tag-thymeleaf"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Spring Boot - Introduction to Thymeleaf - Learn Spring Boot<\/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.kindsonthegenius.com\/spring-boot\/spring-boot-introduction-to-thymeleaf\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Spring Boot - Introduction to Thymeleaf - Learn Spring Boot\" \/>\n<meta property=\"og:description\" content=\"In this lesson, I would teach you how to display date in html form. We would use Thymeleaf to achieve this. &nbsp; Overview of Thymeleaf &hellip;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.kindsonthegenius.com\/spring-boot\/spring-boot-introduction-to-thymeleaf\/\" \/>\n<meta property=\"og:site_name\" content=\"Learn Spring Boot\" \/>\n<meta property=\"article:published_time\" content=\"2019-06-20T02:20:13+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.kindsonthegenius.com\/spring-boot\/wp-content\/uploads\/sites\/7\/2019\/06\/Introduction-to-Thymeleaf.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"746\" \/>\n\t<meta property=\"og:image:height\" content=\"401\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"kindsonthegenius\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"kindsonthegenius\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/spring-boot\\\/spring-boot-introduction-to-thymeleaf\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/spring-boot\\\/spring-boot-introduction-to-thymeleaf\\\/\"},\"author\":{\"name\":\"kindsonthegenius\",\"@id\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/spring-boot\\\/#\\\/schema\\\/person\\\/7f8fc5792578d2ff54003fcebe6c46b5\"},\"headline\":\"Spring Boot &#8211; Introduction to Thymeleaf\",\"datePublished\":\"2019-06-20T02:20:13+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/spring-boot\\\/spring-boot-introduction-to-thymeleaf\\\/\"},\"wordCount\":459,\"commentCount\":3,\"image\":{\"@id\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/spring-boot\\\/spring-boot-introduction-to-thymeleaf\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/spring-boot\\\/wp-content\\\/uploads\\\/sites\\\/7\\\/2019\\\/06\\\/Introduction-to-Thymeleaf.jpg\",\"keywords\":[\"Thymeleaf\"],\"articleSection\":[\"Spring Boot Tutorials\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.kindsonthegenius.com\\\/spring-boot\\\/spring-boot-introduction-to-thymeleaf\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/spring-boot\\\/spring-boot-introduction-to-thymeleaf\\\/\",\"url\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/spring-boot\\\/spring-boot-introduction-to-thymeleaf\\\/\",\"name\":\"Spring Boot - Introduction to Thymeleaf - Learn Spring Boot\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/spring-boot\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/spring-boot\\\/spring-boot-introduction-to-thymeleaf\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/spring-boot\\\/spring-boot-introduction-to-thymeleaf\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/spring-boot\\\/wp-content\\\/uploads\\\/sites\\\/7\\\/2019\\\/06\\\/Introduction-to-Thymeleaf.jpg\",\"datePublished\":\"2019-06-20T02:20:13+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/spring-boot\\\/#\\\/schema\\\/person\\\/7f8fc5792578d2ff54003fcebe6c46b5\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/spring-boot\\\/spring-boot-introduction-to-thymeleaf\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.kindsonthegenius.com\\\/spring-boot\\\/spring-boot-introduction-to-thymeleaf\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/spring-boot\\\/spring-boot-introduction-to-thymeleaf\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/spring-boot\\\/wp-content\\\/uploads\\\/sites\\\/7\\\/2019\\\/06\\\/Introduction-to-Thymeleaf.jpg\",\"contentUrl\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/spring-boot\\\/wp-content\\\/uploads\\\/sites\\\/7\\\/2019\\\/06\\\/Introduction-to-Thymeleaf.jpg\",\"width\":746,\"height\":401,\"caption\":\"Introduction to Thymeleaf\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/spring-boot\\\/spring-boot-introduction-to-thymeleaf\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/spring-boot\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Spring Boot &#8211; Introduction to Thymeleaf\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/spring-boot\\\/#website\",\"url\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/spring-boot\\\/\",\"name\":\"Learn Spring Boot\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/spring-boot\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/spring-boot\\\/#\\\/schema\\\/person\\\/7f8fc5792578d2ff54003fcebe6c46b5\",\"name\":\"kindsonthegenius\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/b9d710de456c3d85e5614c3a6992fa3d527425e2ab32b8bd5d85bfbaa235004b?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/b9d710de456c3d85e5614c3a6992fa3d527425e2ab32b8bd5d85bfbaa235004b?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/b9d710de456c3d85e5614c3a6992fa3d527425e2ab32b8bd5d85bfbaa235004b?s=96&d=mm&r=g\",\"caption\":\"kindsonthegenius\"},\"url\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/spring-boot\\\/author\\\/kindsonthegenius-3\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Spring Boot - Introduction to Thymeleaf - Learn Spring Boot","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.kindsonthegenius.com\/spring-boot\/spring-boot-introduction-to-thymeleaf\/","og_locale":"en_US","og_type":"article","og_title":"Spring Boot - Introduction to Thymeleaf - Learn Spring Boot","og_description":"In this lesson, I would teach you how to display date in html form. We would use Thymeleaf to achieve this. &nbsp; Overview of Thymeleaf &hellip;","og_url":"https:\/\/www.kindsonthegenius.com\/spring-boot\/spring-boot-introduction-to-thymeleaf\/","og_site_name":"Learn Spring Boot","article_published_time":"2019-06-20T02:20:13+00:00","og_image":[{"width":746,"height":401,"url":"https:\/\/www.kindsonthegenius.com\/spring-boot\/wp-content\/uploads\/sites\/7\/2019\/06\/Introduction-to-Thymeleaf.jpg","type":"image\/jpeg"}],"author":"kindsonthegenius","twitter_card":"summary_large_image","twitter_misc":{"Written by":"kindsonthegenius","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.kindsonthegenius.com\/spring-boot\/spring-boot-introduction-to-thymeleaf\/#article","isPartOf":{"@id":"https:\/\/www.kindsonthegenius.com\/spring-boot\/spring-boot-introduction-to-thymeleaf\/"},"author":{"name":"kindsonthegenius","@id":"https:\/\/www.kindsonthegenius.com\/spring-boot\/#\/schema\/person\/7f8fc5792578d2ff54003fcebe6c46b5"},"headline":"Spring Boot &#8211; Introduction to Thymeleaf","datePublished":"2019-06-20T02:20:13+00:00","mainEntityOfPage":{"@id":"https:\/\/www.kindsonthegenius.com\/spring-boot\/spring-boot-introduction-to-thymeleaf\/"},"wordCount":459,"commentCount":3,"image":{"@id":"https:\/\/www.kindsonthegenius.com\/spring-boot\/spring-boot-introduction-to-thymeleaf\/#primaryimage"},"thumbnailUrl":"https:\/\/www.kindsonthegenius.com\/spring-boot\/wp-content\/uploads\/sites\/7\/2019\/06\/Introduction-to-Thymeleaf.jpg","keywords":["Thymeleaf"],"articleSection":["Spring Boot Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.kindsonthegenius.com\/spring-boot\/spring-boot-introduction-to-thymeleaf\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.kindsonthegenius.com\/spring-boot\/spring-boot-introduction-to-thymeleaf\/","url":"https:\/\/www.kindsonthegenius.com\/spring-boot\/spring-boot-introduction-to-thymeleaf\/","name":"Spring Boot - Introduction to Thymeleaf - Learn Spring Boot","isPartOf":{"@id":"https:\/\/www.kindsonthegenius.com\/spring-boot\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.kindsonthegenius.com\/spring-boot\/spring-boot-introduction-to-thymeleaf\/#primaryimage"},"image":{"@id":"https:\/\/www.kindsonthegenius.com\/spring-boot\/spring-boot-introduction-to-thymeleaf\/#primaryimage"},"thumbnailUrl":"https:\/\/www.kindsonthegenius.com\/spring-boot\/wp-content\/uploads\/sites\/7\/2019\/06\/Introduction-to-Thymeleaf.jpg","datePublished":"2019-06-20T02:20:13+00:00","author":{"@id":"https:\/\/www.kindsonthegenius.com\/spring-boot\/#\/schema\/person\/7f8fc5792578d2ff54003fcebe6c46b5"},"breadcrumb":{"@id":"https:\/\/www.kindsonthegenius.com\/spring-boot\/spring-boot-introduction-to-thymeleaf\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.kindsonthegenius.com\/spring-boot\/spring-boot-introduction-to-thymeleaf\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.kindsonthegenius.com\/spring-boot\/spring-boot-introduction-to-thymeleaf\/#primaryimage","url":"https:\/\/www.kindsonthegenius.com\/spring-boot\/wp-content\/uploads\/sites\/7\/2019\/06\/Introduction-to-Thymeleaf.jpg","contentUrl":"https:\/\/www.kindsonthegenius.com\/spring-boot\/wp-content\/uploads\/sites\/7\/2019\/06\/Introduction-to-Thymeleaf.jpg","width":746,"height":401,"caption":"Introduction to Thymeleaf"},{"@type":"BreadcrumbList","@id":"https:\/\/www.kindsonthegenius.com\/spring-boot\/spring-boot-introduction-to-thymeleaf\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.kindsonthegenius.com\/spring-boot\/"},{"@type":"ListItem","position":2,"name":"Spring Boot &#8211; Introduction to Thymeleaf"}]},{"@type":"WebSite","@id":"https:\/\/www.kindsonthegenius.com\/spring-boot\/#website","url":"https:\/\/www.kindsonthegenius.com\/spring-boot\/","name":"Learn Spring Boot","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.kindsonthegenius.com\/spring-boot\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.kindsonthegenius.com\/spring-boot\/#\/schema\/person\/7f8fc5792578d2ff54003fcebe6c46b5","name":"kindsonthegenius","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/b9d710de456c3d85e5614c3a6992fa3d527425e2ab32b8bd5d85bfbaa235004b?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/b9d710de456c3d85e5614c3a6992fa3d527425e2ab32b8bd5d85bfbaa235004b?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/b9d710de456c3d85e5614c3a6992fa3d527425e2ab32b8bd5d85bfbaa235004b?s=96&d=mm&r=g","caption":"kindsonthegenius"},"url":"https:\/\/www.kindsonthegenius.com\/spring-boot\/author\/kindsonthegenius-3\/"}]}},"_links":{"self":[{"href":"https:\/\/www.kindsonthegenius.com\/spring-boot\/wp-json\/wp\/v2\/posts\/167","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kindsonthegenius.com\/spring-boot\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.kindsonthegenius.com\/spring-boot\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.kindsonthegenius.com\/spring-boot\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kindsonthegenius.com\/spring-boot\/wp-json\/wp\/v2\/comments?post=167"}],"version-history":[{"count":1,"href":"https:\/\/www.kindsonthegenius.com\/spring-boot\/wp-json\/wp\/v2\/posts\/167\/revisions"}],"predecessor-version":[{"id":170,"href":"https:\/\/www.kindsonthegenius.com\/spring-boot\/wp-json\/wp\/v2\/posts\/167\/revisions\/170"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.kindsonthegenius.com\/spring-boot\/wp-json\/wp\/v2\/media\/169"}],"wp:attachment":[{"href":"https:\/\/www.kindsonthegenius.com\/spring-boot\/wp-json\/wp\/v2\/media?parent=167"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kindsonthegenius.com\/spring-boot\/wp-json\/wp\/v2\/categories?post=167"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kindsonthegenius.com\/spring-boot\/wp-json\/wp\/v2\/tags?post=167"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}