Creating Login Page
Start course
Difficulty
Beginner
Duration
2h 34m
Students
234
Ratings
3.6/5
starstarstarstar-halfstar-border
Description

In this course, we will learn the concepts of microservice and spring framework with a focus on Spring Boot.

Learning Objectives

  • Understanding Spring Boot

Intended Audience

  • Beginner Java developers
  • Java developers interested in learning how to Build and Deploy RESTful Web Services
  • Java Developers who want to develop web applications using the Spring framework
  • Java Developers who want to develop web applications with microservices
  • Java Developers who wish to develop Spring Boot Microservices with Spring Cloud

Prerequisites

  • Basic Java knowledge
Transcript

Hello, dear friends!

In this video, we will create our login page and the login operations. Let's get started. First, we'll build this project with MVC and you already know that MVC requires controllers and views. However, for login, I won't use any controllers. Instead, I'll use web MVC configure. Let's start with the login page design first. 'Open' the AdminLTE folder. Now, in the examples there are two login pages and you can use any. I will use the first one. Open with notepad. Now, Copy all. Return to Eclipse. Now, let's add a new HTML page into the Templates folder, name it Login. Now, 'Paste.' Look, there's a Bootstrap CSS file here. We need to include it in our project. Now, change paths. Let's have a look at JavaScript.

Okay, done. Now, we can delete unnecessary elements like Google and Facebook logins. For now, this will be enough for us. Now, we have to adjust name values for the user entity. The first name is email, the second one is password. Now, the page is ready, let's continue. The easiest way to get started using Spring Boot is to create a main class and annotate it with @SpringBootApplication. Now, in the main method, we have to activate the Spring application. The single annotation is equivalent to using @configuration, @enableautoconfiguration and @componentscan. By default, it will scan all the components in the same package. Next for the Java-based configuration of Spring beans, we need to create a config class and add the @configuration annotation.

Add new class and name it WebConfig. Now, this class implements the web MVC configure interface. Now, let's add a configuration annotation. This annotation is the main artifact used by the Java-based Spring configuration. It is itself meta annotated with @component which makes the annotated classes common beans and as such also candidates for component scanning. The main purpose of @configuration classes is to be sources of bean definitions for the Spring IOC container. Now, we have to override the AddViewControllers method. In this method, we will define our application start class. Registry.AddViewController. Now, we have to give it a path-like index. We don't have an index page for now, but in the following videos we will define this page. The second one is of course login. Now, AdminHome. The last one will be EmployeeHome. Okay, done.

Now, let's define our bean. SpringSecurityDialect. The method name will be securityDialect. In this only we will return a new dialect. Done. For validations, we first have to add a MessageSource with the dependency injection method. Now, override the getValidator method. First define the validator factory. Now, set the validation message. Done. Okay, that should do it for this video. Let's take a short break here and we'll continue working on the project with login functionality in the following video. See you in the following video.

 

About the Author
Students
1985
Courses
64
Learning Paths
4

OAK Academy is made up of tech experts who have been in the sector for years and years and are deeply rooted in the tech world. They specialize in critical areas like cybersecurity, coding, IT, game development, app monetization, and mobile development.