{"id":213,"date":"2020-01-31T16:49:30","date_gmt":"2020-01-31T16:49:30","guid":{"rendered":"https:\/\/www.kindsonthegenius.com\/spring-boot\/?p=213"},"modified":"2020-08-11T17:33:32","modified_gmt":"2020-08-11T17:33:32","slug":"how-to-user-registration-page-in-spring-boot-java","status":"publish","type":"post","link":"https:\/\/www.kindsonthegenius.com\/spring-boot\/how-to-user-registration-page-in-spring-boot-java\/","title":{"rendered":"Complete Application with Spring Boot \u2013 Part 4 -User Registration Page"},"content":{"rendered":"<p>This corresponds to Part 40 of our Complete Spring Boot Application (FleetMS) and we would create the user registration page. You will need to take the following 6 steps<\/p>\n<ol>\n<li><a href=\"#t1\">Create the Registration Page<\/a><\/li>\n<li><a href=\"#t2\">Update the Model and Database<\/a><\/li>\n<li><a href=\"#t3\">Write the ConfirmPassword Script<\/a><\/li>\n<li><a href=\"#t4\">Modify the Security Config<\/a><\/li>\n<li><a href=\"#t5\">Modify the addNew Method<\/a><\/li>\n<li><a href=\"#t6\">Add a Success Message<\/a><\/li>\n<li><a href=\"#t7\">Encode Your Password<\/a><\/li>\n<\/ol>\n<p>Let&#8217;s dive right in!<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Before you begin, you need to write the endpoint for \/register.<\/strong><\/p>\n<p>&nbsp;<\/p>\n<h5><strong id=\"t1\">Step 1: Create the Registration page<\/strong><\/h5>\n<p>The easiest way to do this is to make a copy of the login page and name it register.html. Then add additional fields for Firstname, Lastname and ConfirmPassword.<\/p>\n<p>Also remember to set the th:action to &#8220;\/users\/addNew&#8221;. As you already know, the method should be post.<\/p>\n<p>Add a message placeholder using the code below<\/p>\n<pre style=\"margin: 0; line-height: 125%;\"><span style=\"color: #007700;\">&lt;span<\/span> <span style=\"color: #0000cc;\">th:text=<\/span><span style=\"background-color: #fff0f0;\">\"${message}\"<\/span><span style=\"color: #007700;\">&gt;&lt;\/span&gt;<\/span>\r\n<\/pre>\n<p>Then set the id of the password text field to password and the id of the confirmPassword field to confirmPassword<\/p>\n<p>&nbsp;<\/p>\n<h5><strong id=\"t2\">Step 2: Update the Model and Database<\/strong><\/h5>\n<p>Now update the User.java class to include Firstname and Lastname fields<\/p>\n<p>Run the application and check that these fields are created in the database<\/p>\n<p>If not, then manually create them. This means, you need to open MySQL Command Prompt and write the queries.<\/p>\n<p>Moreover, ensure that the id field is an auto_increment field.<\/p>\n<p>&nbsp;<\/p>\n<h5><strong id=\"t3\">Step 3: Write the Password Confirmation Script<\/strong><\/h5>\n<p>Now we are going to write the JavaScript code to confirm that the passwords match.<\/p>\n<p>Create a new file in the js folder called register.js.<\/p>\n<p>Include the code below:<\/p>\n<pre style=\"margin: 0; line-height: 125%;\">$(<span style=\"background-color: #fff0f0;\">'document'<\/span>).ready(<span style=\"color: #008800; font-weight: bold;\">function<\/span>(){\t\t\t\r\n\t<span style=\"color: #008800; font-weight: bold;\">var<\/span> password <span style=\"color: #333333;\">=<\/span> <span style=\"color: #007020;\">document<\/span>.getElementById(<span style=\"background-color: #fff0f0;\">\"password\"<\/span>)\r\n\t<span style=\"color: #008800; font-weight: bold;\">var<\/span> confirmPassword <span style=\"color: #333333;\">=<\/span> <span style=\"color: #007020;\">document<\/span>.getElementById(<span style=\"background-color: #fff0f0;\">\"confirmPassword\"<\/span>);\r\n\t\r\n\t<span style=\"color: #008800; font-weight: bold;\">function<\/span> validatePassword(){\r\n\t  <span style=\"color: #008800; font-weight: bold;\">if<\/span>(password.value <span style=\"color: #333333;\">!=<\/span> confirmPassword.value) {\r\n\t    confirmPassword.setCustomValidity(<span style=\"background-color: #fff0f0;\">\"Passwords Don't Match\"<\/span>);\r\n\t  } <span style=\"color: #008800; font-weight: bold;\">else<\/span> {\r\n\t    confirmPassword.setCustomValidity(<span style=\"background-color: #fff0f0;\">''<\/span>);\r\n\t  }\r\n\t}\t\r\n\tpassword.onchange <span style=\"color: #333333;\">=<\/span> validatePassword;\r\n\tconfirmPassword.onkeyup <span style=\"color: #333333;\">=<\/span> validatePassword;\t\t\r\n});\r\n<\/pre>\n<p>&nbsp;<\/p>\n<h5><strong id=\"t4\">Step 4: Modify the SecurityConfiguration<\/strong><\/h5>\n<p>Now we need to modify the security configuration to allow access to the register.html and register.js without authentication. Also we should allow access to the &#8220;\/user\/addNew&#8221; endpoint.<\/p>\n<p>Open the ApplicationSecurityConfig.java file<\/p>\n<p>Add an antMatcher() for &#8220;\/register&#8221; and &#8220;\/users\/addNew&#8221;.<\/p>\n<p>For the &#8220;\/register&#8221; you need to allow access the the js folder by also adding &#8220;\/js\/**&#8221;.<\/p>\n<p>So the addition to the file is as shown below:<\/p>\n<pre style=\"margin: 0; line-height: 125%;\"><span style=\"color: #333333;\">.<\/span><span style=\"color: #0000cc;\">antMatchers<\/span><span style=\"color: #333333;\">(<\/span><span style=\"background-color: #fff0f0;\">\"\/register\"<\/span><span style=\"color: #333333;\">,<\/span> \r\n\t\t<span style=\"background-color: #fff0f0;\">\"\/resources\/**\"<\/span><span style=\"color: #333333;\">,<\/span> \r\n\t\t<span style=\"background-color: #fff0f0;\">\"\/css\/**\"<\/span><span style=\"color: #333333;\">,<\/span> \r\n\t\t<span style=\"background-color: #fff0f0;\">\"\/fonts\/**\"<\/span><span style=\"color: #333333;\">,<\/span> \r\n\t\t<span style=\"background-color: #fff0f0;\">\"\/img\/**\"<\/span><span style=\"color: #333333;\">,<\/span> \r\n\t\t<span style=\"background-color: #fff0f0;\">\"\/js\/**\"<\/span><span style=\"color: #333333;\">).<\/span><span style=\"color: #0000cc;\">permitAll<\/span><span style=\"color: #333333;\">()<\/span>\r\n<span style=\"color: #333333;\">.<\/span><span style=\"color: #0000cc;\">antMatchers<\/span><span style=\"color: #333333;\">(<\/span><span style=\"background-color: #fff0f0;\">\"\/users\/addNew\"<\/span><span style=\"color: #333333;\">).<\/span><span style=\"color: #0000cc;\">permitAll<\/span><span style=\"color: #333333;\">()<\/span>\r\n<\/pre>\n<p>&nbsp;<\/p>\n<h5><strong id=\"t5\">Step 5: Modify the &#8220;addNew&#8221; Method<\/strong><\/h5>\n<p>We now need to modify the method for saving a new user. This because, we want a successful user registration to redirect to the login page.<\/p>\n<p>We would also display a message telling the user that the registration was successful and he can go on to login.<\/p>\n<p>Open the UserController, change the addNew method to the one below:<\/p>\n<pre style=\"margin: 0; line-height: 125%;\"><span style=\"color: #888888;\">\/\/Modified method to Add a new user User<\/span>\r\n<span style=\"color: #555555; font-weight: bold;\">@PostMapping<\/span><span style=\"color: #333333;\">(<\/span>value<span style=\"color: #333333;\">=<\/span><span style=\"background-color: #fff0f0;\">\"users\/addNew\"<\/span><span style=\"color: #333333;\">)<\/span>\r\n<span style=\"color: #008800; font-weight: bold;\">public<\/span> RedirectView <span style=\"color: #0066bb; font-weight: bold;\">addNew<\/span><span style=\"color: #333333;\">(<\/span>User user<span style=\"color: #333333;\">,<\/span> RedirectAttributes redir<span style=\"color: #333333;\">)<\/span> <span style=\"color: #333333;\">{<\/span>\r\n\tuserService<span style=\"color: #333333;\">.<\/span><span style=\"color: #0000cc;\">save<\/span><span style=\"color: #333333;\">(<\/span>user<span style=\"color: #333333;\">);<\/span>\t\r\n\tRedirectView  redirectView<span style=\"color: #333333;\">=<\/span> <span style=\"color: #008800; font-weight: bold;\">new<\/span> RedirectView<span style=\"color: #333333;\">(<\/span><span style=\"background-color: #fff0f0;\">\"\/login\"<\/span><span style=\"color: #333333;\">,<\/span><span style=\"color: #008800; font-weight: bold;\">true<\/span><span style=\"color: #333333;\">);<\/span>\r\n        redir<span style=\"color: #333333;\">.<\/span><span style=\"color: #0000cc;\">addFlashAttribute<\/span><span style=\"color: #333333;\">(<\/span><span style=\"background-color: #fff0f0;\">\"message\"<\/span><span style=\"color: #333333;\">,<\/span>\r\n    \t\t<span style=\"background-color: #fff0f0;\">\"You successfully registered! You can now login\"<\/span><span style=\"color: #333333;\">);<\/span>\r\n    <span style=\"color: #008800; font-weight: bold;\">return<\/span> redirectView<span style=\"color: #333333;\">;<\/span>\t\t\t\t\r\n<span style=\"color: #333333;\">}<\/span>\t\r\n<\/pre>\n<p>Just to explain briefly what is happening here.<\/p>\n<p>First we did not use Model and addAttributes. The reason is that, values in the model attributes are cleared after redirect.<\/p>\n<p>Therefore, we make the method return a RedirectView instead of a string(view). Then we place a flashAttribute in the\u00a0RedirectAttributes object. In this way, the value of the flash attribute is preserved when a redirect occurs.<\/p>\n<p>&nbsp;<\/p>\n<h5><strong id=\"t6\">Step 6: Add the Success Message<\/strong><\/h5>\n<p>Since we need to redurect to the login page after registration, the success message will therefore be placed in the login page. But it shows only if a redirect occurs from the register page.<\/p>\n<p>Open the login page.<\/p>\n<p>Just below the opening &lt;form&gt; tag, add the following code:<\/p>\n<pre style=\"margin: 0; line-height: 125%;\"><span style=\"color: #007700;\">&lt;div<\/span> <span style=\"color: #0000cc;\">style=<\/span><span style=\"background-color: #fff0f0;\">\"text-align:center; font-size:20px; color:green; font-weight:bold\"<\/span><span style=\"color: #007700;\">&gt;<\/span>  \r\n    <span style=\"color: #007700;\">&lt;span<\/span> <span style=\"color: #0000cc;\">th:utext=<\/span><span style=\"background-color: #fff0f0;\">\"${message}\"<\/span><span style=\"color: #007700;\">&gt;&lt;\/span&gt;<\/span> \r\n<span style=\"color: #007700;\">&lt;\/div&gt;<\/span>\r\n<\/pre>\n<p>&nbsp;<\/p>\n<h5><strong id=\"t7\">Step 7: Encode the Password<\/strong><\/h5>\n<p>Now we would encode the password using BCryptPasswordEncoder. Although there are other encoders, BCrypt offers a stronger encryption algorithm than most. We&#8217;ll do this in just three steps.<\/p>\n<ul>\n<li><strong>First<\/strong>, create a BCryptPasswordEncoder bean in the ApplicationSecurityConfig file. The bean is as shown below:<\/li>\n<\/ul>\n<pre style=\"margin: 0; line-height: 125%;\"><span style=\"color: #555555; font-weight: bold;\">@Bean<\/span>\r\n<span style=\"color: #008800; font-weight: bold;\">public<\/span> BCryptPasswordEncoder <span style=\"color: #0066bb; font-weight: bold;\">bCryptPasswordEncoder<\/span><span style=\"color: #333333;\">()<\/span> <span style=\"color: #333333;\">{<\/span>\r\n\t<span style=\"color: #008800; font-weight: bold;\">return<\/span> <span style=\"color: #008800; font-weight: bold;\">new<\/span> <span style=\"color: #0066bb; font-weight: bold;\">BCryptPasswordEncoder<\/span><span style=\"color: #333333;\">();<\/span>\r\n<span style=\"color: #333333;\">}<\/span>\r\n<\/pre>\n<ul>\n<li><strong>Second<\/strong>, set providers encoder to use a BCryptPasswordEncoder type instead of NoOpPasswordEncoder<\/li>\n<li><strong>Third<\/strong>, open the UserService. Modify the save method such that before you save, you need to set the password. Use setPassword and then provide an encoded password.<\/li>\n<\/ul>\n<p>Now you can test the application!<\/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>This corresponds to Part 40 of our Complete Spring Boot Application (FleetMS) and we would create the user registration page. You will need to take &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":216,"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":[23,22],"class_list":["post-213","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-spring-boot-tutorials","tag-bcryptpasswordencoder","tag-user-registration-page"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Complete Application with Spring Boot \u2013 Part 4 -User Registration Page - 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\/how-to-user-registration-page-in-spring-boot-java\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Complete Application with Spring Boot \u2013 Part 4 -User Registration Page - Learn Spring Boot\" \/>\n<meta property=\"og:description\" content=\"This corresponds to Part 40 of our Complete Spring Boot Application (FleetMS) and we would create the user registration page. You will need to take &hellip;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.kindsonthegenius.com\/spring-boot\/how-to-user-registration-page-in-spring-boot-java\/\" \/>\n<meta property=\"og:site_name\" content=\"Learn Spring Boot\" \/>\n<meta property=\"article:published_time\" content=\"2020-01-31T16:49:30+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-08-11T17:33:32+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.kindsonthegenius.com\/spring-boot\/wp-content\/uploads\/sites\/7\/2020\/01\/How-to-Add-User-Registration-Page-in-Spring-Boot.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1118\" \/>\n\t<meta property=\"og:image:height\" content=\"607\" \/>\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=\"4 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\\\/how-to-user-registration-page-in-spring-boot-java\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/spring-boot\\\/how-to-user-registration-page-in-spring-boot-java\\\/\"},\"author\":{\"name\":\"kindsonthegenius\",\"@id\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/spring-boot\\\/#\\\/schema\\\/person\\\/7f8fc5792578d2ff54003fcebe6c46b5\"},\"headline\":\"Complete Application with Spring Boot \u2013 Part 4 -User Registration Page\",\"datePublished\":\"2020-01-31T16:49:30+00:00\",\"dateModified\":\"2020-08-11T17:33:32+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/spring-boot\\\/how-to-user-registration-page-in-spring-boot-java\\\/\"},\"wordCount\":616,\"commentCount\":1,\"image\":{\"@id\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/spring-boot\\\/how-to-user-registration-page-in-spring-boot-java\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/spring-boot\\\/wp-content\\\/uploads\\\/sites\\\/7\\\/2020\\\/01\\\/How-to-Add-User-Registration-Page-in-Spring-Boot.jpg\",\"keywords\":[\"BCryptPasswordEncoder\",\"User Registration Page\"],\"articleSection\":[\"Spring Boot Tutorials\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.kindsonthegenius.com\\\/spring-boot\\\/how-to-user-registration-page-in-spring-boot-java\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/spring-boot\\\/how-to-user-registration-page-in-spring-boot-java\\\/\",\"url\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/spring-boot\\\/how-to-user-registration-page-in-spring-boot-java\\\/\",\"name\":\"Complete Application with Spring Boot \u2013 Part 4 -User Registration Page - Learn Spring Boot\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/spring-boot\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/spring-boot\\\/how-to-user-registration-page-in-spring-boot-java\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/spring-boot\\\/how-to-user-registration-page-in-spring-boot-java\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/spring-boot\\\/wp-content\\\/uploads\\\/sites\\\/7\\\/2020\\\/01\\\/How-to-Add-User-Registration-Page-in-Spring-Boot.jpg\",\"datePublished\":\"2020-01-31T16:49:30+00:00\",\"dateModified\":\"2020-08-11T17:33:32+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/spring-boot\\\/#\\\/schema\\\/person\\\/7f8fc5792578d2ff54003fcebe6c46b5\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/spring-boot\\\/how-to-user-registration-page-in-spring-boot-java\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.kindsonthegenius.com\\\/spring-boot\\\/how-to-user-registration-page-in-spring-boot-java\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/spring-boot\\\/how-to-user-registration-page-in-spring-boot-java\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/spring-boot\\\/wp-content\\\/uploads\\\/sites\\\/7\\\/2020\\\/01\\\/How-to-Add-User-Registration-Page-in-Spring-Boot.jpg\",\"contentUrl\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/spring-boot\\\/wp-content\\\/uploads\\\/sites\\\/7\\\/2020\\\/01\\\/How-to-Add-User-Registration-Page-in-Spring-Boot.jpg\",\"width\":1118,\"height\":607,\"caption\":\"How to Add User Registration Page in Spring Boot\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/spring-boot\\\/how-to-user-registration-page-in-spring-boot-java\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/spring-boot\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Complete Application with Spring Boot \u2013 Part 4 -User Registration Page\"}]},{\"@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":"Complete Application with Spring Boot \u2013 Part 4 -User Registration Page - 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\/how-to-user-registration-page-in-spring-boot-java\/","og_locale":"en_US","og_type":"article","og_title":"Complete Application with Spring Boot \u2013 Part 4 -User Registration Page - Learn Spring Boot","og_description":"This corresponds to Part 40 of our Complete Spring Boot Application (FleetMS) and we would create the user registration page. You will need to take &hellip;","og_url":"https:\/\/www.kindsonthegenius.com\/spring-boot\/how-to-user-registration-page-in-spring-boot-java\/","og_site_name":"Learn Spring Boot","article_published_time":"2020-01-31T16:49:30+00:00","article_modified_time":"2020-08-11T17:33:32+00:00","og_image":[{"width":1118,"height":607,"url":"https:\/\/www.kindsonthegenius.com\/spring-boot\/wp-content\/uploads\/sites\/7\/2020\/01\/How-to-Add-User-Registration-Page-in-Spring-Boot.jpg","type":"image\/jpeg"}],"author":"kindsonthegenius","twitter_card":"summary_large_image","twitter_misc":{"Written by":"kindsonthegenius","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.kindsonthegenius.com\/spring-boot\/how-to-user-registration-page-in-spring-boot-java\/#article","isPartOf":{"@id":"https:\/\/www.kindsonthegenius.com\/spring-boot\/how-to-user-registration-page-in-spring-boot-java\/"},"author":{"name":"kindsonthegenius","@id":"https:\/\/www.kindsonthegenius.com\/spring-boot\/#\/schema\/person\/7f8fc5792578d2ff54003fcebe6c46b5"},"headline":"Complete Application with Spring Boot \u2013 Part 4 -User Registration Page","datePublished":"2020-01-31T16:49:30+00:00","dateModified":"2020-08-11T17:33:32+00:00","mainEntityOfPage":{"@id":"https:\/\/www.kindsonthegenius.com\/spring-boot\/how-to-user-registration-page-in-spring-boot-java\/"},"wordCount":616,"commentCount":1,"image":{"@id":"https:\/\/www.kindsonthegenius.com\/spring-boot\/how-to-user-registration-page-in-spring-boot-java\/#primaryimage"},"thumbnailUrl":"https:\/\/www.kindsonthegenius.com\/spring-boot\/wp-content\/uploads\/sites\/7\/2020\/01\/How-to-Add-User-Registration-Page-in-Spring-Boot.jpg","keywords":["BCryptPasswordEncoder","User Registration Page"],"articleSection":["Spring Boot Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.kindsonthegenius.com\/spring-boot\/how-to-user-registration-page-in-spring-boot-java\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.kindsonthegenius.com\/spring-boot\/how-to-user-registration-page-in-spring-boot-java\/","url":"https:\/\/www.kindsonthegenius.com\/spring-boot\/how-to-user-registration-page-in-spring-boot-java\/","name":"Complete Application with Spring Boot \u2013 Part 4 -User Registration Page - Learn Spring Boot","isPartOf":{"@id":"https:\/\/www.kindsonthegenius.com\/spring-boot\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.kindsonthegenius.com\/spring-boot\/how-to-user-registration-page-in-spring-boot-java\/#primaryimage"},"image":{"@id":"https:\/\/www.kindsonthegenius.com\/spring-boot\/how-to-user-registration-page-in-spring-boot-java\/#primaryimage"},"thumbnailUrl":"https:\/\/www.kindsonthegenius.com\/spring-boot\/wp-content\/uploads\/sites\/7\/2020\/01\/How-to-Add-User-Registration-Page-in-Spring-Boot.jpg","datePublished":"2020-01-31T16:49:30+00:00","dateModified":"2020-08-11T17:33:32+00:00","author":{"@id":"https:\/\/www.kindsonthegenius.com\/spring-boot\/#\/schema\/person\/7f8fc5792578d2ff54003fcebe6c46b5"},"breadcrumb":{"@id":"https:\/\/www.kindsonthegenius.com\/spring-boot\/how-to-user-registration-page-in-spring-boot-java\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.kindsonthegenius.com\/spring-boot\/how-to-user-registration-page-in-spring-boot-java\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.kindsonthegenius.com\/spring-boot\/how-to-user-registration-page-in-spring-boot-java\/#primaryimage","url":"https:\/\/www.kindsonthegenius.com\/spring-boot\/wp-content\/uploads\/sites\/7\/2020\/01\/How-to-Add-User-Registration-Page-in-Spring-Boot.jpg","contentUrl":"https:\/\/www.kindsonthegenius.com\/spring-boot\/wp-content\/uploads\/sites\/7\/2020\/01\/How-to-Add-User-Registration-Page-in-Spring-Boot.jpg","width":1118,"height":607,"caption":"How to Add User Registration Page in Spring Boot"},{"@type":"BreadcrumbList","@id":"https:\/\/www.kindsonthegenius.com\/spring-boot\/how-to-user-registration-page-in-spring-boot-java\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.kindsonthegenius.com\/spring-boot\/"},{"@type":"ListItem","position":2,"name":"Complete Application with Spring Boot \u2013 Part 4 -User Registration Page"}]},{"@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\/213","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=213"}],"version-history":[{"count":8,"href":"https:\/\/www.kindsonthegenius.com\/spring-boot\/wp-json\/wp\/v2\/posts\/213\/revisions"}],"predecessor-version":[{"id":248,"href":"https:\/\/www.kindsonthegenius.com\/spring-boot\/wp-json\/wp\/v2\/posts\/213\/revisions\/248"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.kindsonthegenius.com\/spring-boot\/wp-json\/wp\/v2\/media\/216"}],"wp:attachment":[{"href":"https:\/\/www.kindsonthegenius.com\/spring-boot\/wp-json\/wp\/v2\/media?parent=213"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kindsonthegenius.com\/spring-boot\/wp-json\/wp\/v2\/categories?post=213"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kindsonthegenius.com\/spring-boot\/wp-json\/wp\/v2\/tags?post=213"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}