RESTful Web Services, Java, Spring Boot, Spring MVC and JPA

Implement API calls: Sign-up, sign-in, email verification, password reset, update, delete. Deploy to Amazon AWS Cloud.

4.51 (4093 reviews)
Udemy
platform
English
language
Software Engineering
category
RESTful Web Services, Java, Spring Boot, Spring MVC and JPA
25,516
students
25 hours
content
Jan 2024
last update
$79.99
regular price

What you will learn

Build a RESTful Web Service with Spring Boot

Learn how to implement User Sign-in functionality

Learn how to implement User Sign-up functionality

Protect RESTful Web Service with Spring Security Framework

Learn how to implement Token-Based Authentication

Implement Password Reset and Email Verification features

Use Spring Data JPA Query Methods

Use Spring Data JPA Native SQL Queries

Download and Install MySQL Server on Mac

Download and Install MySQL Workbench

Download and Install Spring Tool Suite

Create new project using Spring Tool Suite and Spring Initializer

Download, run and stop Apache Tomcat

Deploy RESTful Web Service application to Apache Tomcat

Run RESTful Web Service application as a stand along Java application

Build and run REST API with Maven

Use Postman HTTP client to send HTTP Request to a Web Service endpoints

Start up Amazon EC2 server

Install Java, MySQL and Apache Tomcat on Amazon AWS EC2 server

Deploy RESTful Web Service to Amazon AWS EC2 server

Deploy with AWS Beanstalk

Use H2 in-memory database

Use H2 database console to preview data in memory database as well as in a stand along MySQL database server

Use JUnit 5 to test code

Use Rest Assured to test RESTful Web Service endpoint

Why take this course?

This is a very practical video course aimed at beginner Java developers to help them build their very first RESTful Web Service application with Java, Spring Boot and Spring Data JPA to implement features like: 

  • User sign-up and User sign-in, 

  • Email verification,

  • Password Reset,

  • Get user details API call, 

  • Get a list of users API call and implement Pagination, 

  • Update user details and Delete user details API calls, 

  • Learn to secure Web Service endpoints with Spring Security

  • Learn to use Amazon AWS Simple Email Service(SES) to send and request to confirm the user email address, 

  • and learn to generate and include the JSON Web Token in HTTP Request.

Students will learn how to use Postman HTTP client software to send: HTTP POST, GET, DELETE and PUT requests, as well as how to set needed HTTP Headers. We will also cover how to: 

  • Send data to your RESTful WebService via HTTP Body and,

  • How to pass data via URL Query String and as a Path parameter,

  • How to enable your RESTful Web Service to respond to Cross-Origin AJAX HTTP Requests.

You will also learn how to make your RESTful Web Service accept and respond back with JSON or XML media type.

In this video course you will learn how to: 

  • Download and install Spring Tool Suite(STS), 

  • Download and install MySQL server and MySQL Workbench GUI, 

  • Download and run Apache Tomcat,

  • Add a specific Apache Tomcat Version to your Spring Tool Suite, 

  • User Maven to build and run your project as well as package it into a deployable WAR file, 

  • You will also learn how to run your Web Service as a stand-alone Java application with build-in Tomcat, 

  • Deploy your RESTful Web Service to Apache Tomcat as well as, 

  • Startup your own Amazon AWS EC2 Service in Amazon Cloud, install Java, MySQL, Tomcat, and deploy RESTful Web Service to your very own cloud server. 

  • You will also learn how to deploy your application to AWS Beanstalk

This video course also covers the H2 in-memory database and teaches how to build a RESTful Web Service that stores data in a database without a need to install MySQL or any other database server. You will also learn how to use the H2 console to preview data stored in an in-memory database tables or in a MySQL database server.

When it comes to storing data in a database you will learn how to use Spring Data JPA Query Methods as well as Native SQL Queries.

You will also learn how to use JUnit 5 to test your code and how to use one of the most popular test frameworks called Rest Assured to test RESTful Web Service endpoints of your REST API.

Content

Introduction

Source Code
Install HTTP client Postman
Postman overview
Resource and Collection URIs
HTTP Methods: GET, POST, DELETE and PUT
HTTP Headers: Accept and Content Type
Introduction to Web Service Application Layers
A few suggestions

Download, Install and run MySQL Database on Local Computer

Downloading and Installing MySQL on MAC
Start MySQL Server and Login
Creating MySQL Database and a new User
Downloading and Installing MySQL Workbench
Connect to MySQL Database using MySQL WorkBench
MySQL WorkBench brief overview

Setup Development Environment

Install Java Platform (JDK)
Download and Install Spring Tool Suite(STS)

Getting Started. Creating a New Project.

Create new Spring Boot Project with Spring Tool Suite
Creating a new Spring project using Spring Boot Initializr

Quick Start

Create Users Rest Controller class
Adding Methods to Handle POST, GET, PUT, DELETE HTTP requests
Running Web Service Application

Adding MySQL Database Support

Update POM.XML file
Configure MySQL Database Access Details

Implementing User Sign up

Adding method to handle HTTP Post Request
Implementing the Create User Request Model class
Implementing Create User Response Model
Implementing the UserDto
Making use of UserRest and UserDto in RestController
Implementing Service class method
Implementing UserEntity class
Set Default Value for Email Verification Status field
Implementing UsersRepository class
Autowire UserRepository into Service class
Trying how the User Sign up works
Preventing Duplicate Entries with @Column(unique=true)
Check if user already exists
Generate User Public ID

Spring Security for User Sign-up

Adding Spring Security to our project
Encrypt User Password
Make the Sign-up Web Service Endpoint Public

Spring Security for User Sign-in

Implementing User Sign-in Request Model
Implementing Load User By Username
Implementing SecurityConstants class
Implementing Authentication Filter
Trying how user Sign-in works
Add public User ID to a Response Header
Customize User Authentication URL
Implementing Authorization Filter
Trying how User Authorization works
Making Your REST API Stateless
Reading Token Secret from a property file

Implementing Get User Details Web Service Endpoint

Get User Details Resource Method
Implement Service layer method
Update UserRepository
Trying the Get User Details API Call

Adding XML Support & JSON Support

Update POM.XML, Add XML & JSON Media Types
Getting Response in XML or JSON format

Exceptions Handling

Introduction
Implementing ErrorMessages enum
Implementing UserServiceException
Handle a Specific Exception
Return Custom Error Object Representation
Handle All Other Exceptions

Update User Details API Call

Update User Details Resource Method
Implementing Service Layer Method
Trying the Update User Details API Call

Delete User API Call

Delete User Resource Method
Implementing Service Layer Method
Trying the Delete User API Call

Pagination and Get Users API Call

The Get Users Request URL
The Get Users Resource Method
Get Users Service Layer Method
Trying the Get Users API Call

Deploying Your App

Running Your Web Services App without STS
Create Context Path to Your Web Service
Run Your App as a Java application
Generating WAR file
Install Apache Tomcat on Windows
Downloading Apache Tomcat
Starting and Stopping Apache Tomcat
Creating a new Apache Tomcat User
Deploying Your Web Service to Apache Tomcat

Deploying to Amazon Cloud. AWS EC2.

Startup Your Own Amazon EC2 Linux Server
Connect To Your Server via SSH
Update Server Software Packages and Update Java
Download & Install Apache Tomcat on AWS EC2 Linux Server
Configure Apache Tomcat Users
Download and Install MySQL Server on EC2 Linux Server
Create Database and Add Database User
Deploy Our Web Service App on Apache Tomcat
Sending HTTP Request to a WebService Deployed on a Remote Server
Introduction: @OneToOne, @OneToMany, @ManyToOne

Object Relationships: @OneToMany Relationship

Add List of Addresses to JSON Payload
Add List of Addresses to a UserDetailsRequestModel
Creating AddressDTO
A Better Way of Mapping DTO to an Entity and Entity to a DTO
Trying if Deep Objects Mapping Works
Create AddressEntity class
Add @OneToMany to UserEntity class
Generate Public Address Id
Updating Service class Java code
Trying How it Works: Creating a new User record
Include List of Addresses Into Response
Get List of Addresses Web Service Endpoint
Get List of Addresses Service Interface
Get List of Addresses Service Interface Implementation
Get List of Addresses Spring Data JPA Interface
Trying How the Get List of Addresses Works
API Call to Get a Single Address Details

HATEOAS

Introduction
Adding HATEOAS Support to Our Project
Adding Adding Links to a Get User Address API Call
Using the methodOn()
Adding Links to a Get Addresses API Call
Applying HAL Format

Implement Email Verification Feature with AWS SES (Simple Email Service)

Source Code
Introduction
Verify Email Address with Amazon SES
Moving Out of AWS SES Sandbox
Submit Support Ticket to Increate Sending Limits
Create AWS IAM Access Credentials
Creating Shared Credentials File
Add AWS Java SDK SES Maven Dependency
Spring Security. Make Email Verification a Public Web Service Endpoint.
The verifyEmailToken() RestController Method
The verifyEmailToken() Service Layer Function
The findUserByEmailVerificationToken() Data Layer Function
Checking if Email Verification Token Has Expired
Generate and Save the Email Verification Token
Prevent Users with Unverified Email Address to Login
Trying How it works
Create a new Web Project
Download Apache Tomcat and Add to Spring STS
Creating Email Verification Service Web Page
Reading JavaScript URL Request Parameters
The verifyToken() AJAX HTTP Get Request
Deploying REST API and Email Verification Service to a Local Tomcat
Trying Email Verification Feature on Local Server
Adding Code to Send Email
Deploying Email Verification to a Remote Amazon EC2 Linux Server
Trying Email Verification on Remote Server

Implementing Password Reset Feature

Introduction
Password Reset Request RestController Method
Password Reset Request Service Layer Method
Generating Password Reset Token
Create PasswordResetTokenEntity & Password Reset Repository
Update AmazonSES Class with Code that Sends Email
Make the /password-reset-request Public
Trying How Password Reset Request Works
Password Reset HTML Page: Add Input fields
Password Reset HTML Page: Add jQuery
Password Reset HTML Page: Add the saveNewPassword() function
Add Content Type HTTP Header
Password Reset RestController Method
Password Reset Service Layer Method
Making Password Rest URL Public
Deploying RESTful Web Service and the Verification Service App
Trying How Password Reset Works

Testing Service Layer Code with JUnit 5 & Mockito

Introduction to Testing with JUnit & Mockito
Test Cases Source Code and Test Libraries Dependency
Creating a new JUnit 5 Test Case
Mocking Objects with Mockito @Mock
JUnit 5 Assertions. Asserting Successful Method Execution.
JUnit 5. Expect an Exception with assertThrows()
The testCreateUser() method. Mocking Objects.
Testing the createUser() Service Method
The testCreateUser() method. Adding more code.
doNothing(). Exclude Integration Code from Unit Test.
Assert an Exception is thrown in the createUser() method

Testing Rest Controller Methods with JUnit 5

Create a New Test Case
Create Mock Objects and Configure Methods Behaviour
Asserting with assertNotNull, assertEquals and assertTrue

JUnit Integration Test. Testing JWT Tokens and UserId.

Create a new JUnit Integration Test Case
Test the Generate UserId Method
Test If JWT Token Has Not Expired
Test the Expired JWT Token

H2 In-Memory Database

What is H2 In-memory Database and Why Using It
H2 Database Console Preview
Adding Support for the H2 Database
Sign in to H2 In-Memory Database
Protect the H2 In-Memory Database with a Password
API Call to Create a New User and Preview User Details in an In-Memory Database

Testing RESTful Web Services with Rest Assured

Source code
Introduction
Creating a new maven project
Add support for Rest Assured and JUnit 5 to your project
Create User API Call: Creating a Test Method
Create User API Call: Setting Request URL, Context Path and a Port number
Create User API Call: Create HTTP Post Request and Validate Response
Create User API Call: Running a Test Case
Create User API Call: Verify JSON Array with a list of Addresses
User Login API Call: Create Test Class
User Login API Call: Create Test Method
User Login API Call: Run Test Method
JUnit Test Methods ordering with @FixMethodOrder
Get User Details API Call: Create Test method
Get User Details API Call: Validating List of Addresses
Get User Details API Call: Use the pathParam()
Get User Details API Call: Running Test Method
Update User Details API Call: Create Test Method & HTTP Request
Update User Details API Call: Validating HTTP Response
Delete User Details API Call: Create Test Method
Delete User Details API Call: Run Test Method

Using Native SQL Queries

Introduction. What If You Need to Run SQL Query?
Native SELECT SQL Query Example
JUnit Test to test Native SELECT SQL Query
Native SQL Query with Positional Parameters
Native SQL Query with Named Parameters
Log SQL Queries and Their Values in the Console
Using Advanced LIKE Expressions
Select Specific Columns from a Table
UPDATE SQL Query Example

Using Java Persistence Query Language(JPQL)

JPQL Introduction
JPQL Select SQL Query
JPQL Query to Select Specific Fields Only
JPQL Update SQL Query

Cross Origin AJAX HTTP Requests. CORS.

Do I Need To Enable CORS?
Send HTTP Request to Reproduce Cross Origin Issue
Enable Cross Origin Requests in Rest Controller
Global CORS configuration
Spring Security Configuration for CORS

My Contact Details

My Contact Details

Create Interactive Documentation for your REST API with Swagger

Introduction
Add Swagger Dependencies
Create Swagger Configuration File
Enable Swagger URLs and View JSON Documentation
View API Documentation In Swagger UI
Add Authorization Header
Add /login endpoint
Upading API Documentation Information
Web Service Endpoints Additional Information
Share Your API with Others
Share Swagger UI URL

Spring Security Roles and Authorities

Introduction to Roles and Authorities
Authentication vs Authorization
Database Tables Design
User Roles @ManyToMany Mapping for User Entity
Create RoleEntity
Role Authority @ManyToMany Mapping for the RoleEntity
Create AuthorityEntity
Create Role Repository
Create Authority Repository
Creating Initial Roles, Authorities and Admin User
Create InitialUsersSetup Class
Creating Authorities: READ, WRITE, DELETE
Creating Roles: ROLE_ADMIN, ROLE_USER
Create User with Admin Role
Create User Principal Class
Update Authentication and Authorization Filters
Configure HttpSecurity to Use the ADMIN Role
Configure HttpSecurity to Use the DELETE_AUTHORITY
hasAnyRole() and hasAnyAuthority()
Method Level Security Introduction
Enable Global Method Security
@Secured Annotation Example
@PreAuthorize Annotation Example
Accessing Principal Object and Method Argument
Trying How It Works
@PostAuthorize Annotation Example
Assign ROLE_USER to a Regular User

Screenshots

RESTful Web Services, Java, Spring Boot, Spring MVC and JPA - Screenshot_01RESTful Web Services, Java, Spring Boot, Spring MVC and JPA - Screenshot_02RESTful Web Services, Java, Spring Boot, Spring MVC and JPA - Screenshot_03RESTful Web Services, Java, Spring Boot, Spring MVC and JPA - Screenshot_04

Our review

🌟 **Course Overview:** **Global Course Rating:** 4.51 This course has received a wide range of reviews, reflecting the diverse experiences of students from different backgrounds and skill levels. Overall, the course has been found to be very helpful for those looking to implement RESTful Web Services using Spring Boot, Hibernate, and MySQL, with a focus on practical, hands-on experience from scratch. The instructor, Sergey, is consistently praised for his clear explanations and structured video lessons. **Pros:** - πŸŽ“ **Comprehensive Content:** Many students have found the course to be complete and beneficial for understanding and applying RESTful Web Services. - βœ… **Real-world Application:** The course has been highly rated for its practical approach, offering a step-by-step guide that is very helpful for both beginners and intermediate developers. - πŸ› οΈ **Clearly Explained:** Sergey's explanations are appreciated for being detailed and well-paced, allowing learners to grasp complex concepts with ease. - 🀝 **Well-structured:** The course is praised for its structured approach, which has helped students to follow along and apply the knowledge in their work. - πŸš€ **Advanced Features Coverage:** The course covers advanced features, testing, and deployment, providing a thorough understanding of Spring Boot. - 🌟 **Positive Impact:** Students have reported that this course has significantly improved their coding skills and helped them secure job positions. **Cons:** - ❌ **Not for Beginners:** A notable concern is that the course assumes some prior knowledge, which can be confusing for true beginners. - πŸ“ **Overreliance on Copy-Pasting:** Some students have experienced difficulties when the code provided in the course did not match their development environments, particularly due to differences in Java versions or outdated examples. - πŸ› οΈ **Outdated Content:** The content of the course is considered outdated by some students, with significant changes in Spring Boot and Spring Security since the course's creation. - ✍️ **Code Visibility:** A few students have faced challenges with the visibility of code during video playback, especially when using captions. - 🧩 **Inconsistencies in Resources:** There are instances where the course references resources that may have changed or differ from what is currently available. **Additional Notes and Suggestions:** - 🎯 **Update Content:** To address the issues of outdated content, it is recommended that the course be updated to reflect the current versions of Spring Boot and Spring Security. - πŸ“š **Accompanying Materials:** Some students suggest providing updated code examples alongside the older ones to aid in learning and understanding the newer technologies. - β™« **Improved Caption Placement:** For the benefit of non-native English speakers or those who use captions, it would be helpful to display code at the top and mid-screen during video lessons. **Final Thoughts:** The course has been a valuable resource for many students looking to gain expertise in Spring Boot and RESTful Web Services. With some updates to the content and potentially improved captioning for code examples, it could provide an even more enriching learning experience. The clear and humble teaching style of Sergey is commendable and has undoubtedly contributed to the positive feedback from the student community.

Charts

Price

RESTful Web Services, Java, Spring Boot, Spring MVC and JPA - Price chart

Rating

RESTful Web Services, Java, Spring Boot, Spring MVC and JPA - Ratings chart

Enrollment distribution

RESTful Web Services, Java, Spring Boot, Spring MVC and JPA - Distribution chart
1616708
udemy ID
3/26/2018
course created date
8/11/2019
course indexed date
Bot
course submited by