Posted in Angular Spring Boot

Angular Spring Boot Security JWT Authentication And Authorization

Introduction In this post you will see an example about Angular Spring Boot Security JWT (JSON Web Token) Authentication and role based Authorization for REST APIs or RESTful services. I won’t explain here about JWT as there is already very good article on JWT. I will implement Spring Security’s UserDetailsService to load user from database. I will use Spring Data JPA…

Continue Reading... Angular Spring Boot Security JWT Authentication And Authorization
Posted in Spring Boot Spring JPA

Bootstrap AJAX Spring Boot Pagination

Introduction In this tutorial I will use Spring Data JPA Pageable to build REST API for pagination in Spring Boot applications. Here, I am going to show you how to build pagination using Bootstrap jQuery – AJAX with Spring Boot applications. Using jQuery – AJAX, you don’t need to load or fetch all records from server side, and you are…

Continue Reading... Bootstrap AJAX Spring Boot Pagination
Posted in Spring Boot Spring JPA

Bulk Delete Using Spring JPA CriteriaDelete

Criteria Delete The new feature bulk delete operation in Criteria API was added in JPA 2.1. I will show you an example how to perform bulk delete using Spring JPA CriteriaDelete. The CriteriaDelete interface can be used to implement bulk delete operations. Delete operations performed through CriteriaDelete interface are directly mapped to database delete operations. Hence the persistent context is…

Continue Reading... Bulk Delete Using Spring JPA CriteriaDelete
Posted in Spring Boot Spring JPA

Bulk Update Using Spring JPA CriteriaUpdate

Criteria Update The new feature bulk update operation in Criteria API was added in JPA 2.1. I will show you an example how to perform bulk update using Spring JPA CriteriaUpdate. The CriteriaUpdate interface can be used to implement bulk update operations. Update operations performed through CriteriaUpdate interface are directly mapped to database update operations. Hence the persistent context is…

Continue Reading... Bulk Update Using Spring JPA CriteriaUpdate
Posted in Junit Spring Boot Spring JDBC

Spring JdbcNamedParameterTemplate Junit Mockito

Introduction In the tutorial, Spring NamedParameterJdbcTemplate and MapSqlParameterSource Example, I had shown how to save new record in the database and how to fetch record from database. Here I am going to show you how to mock Spring JdbcNamedParameterTemplate SqlParameterSource with Junit Mockito. I am going to use Junit 5 framework for this example. I am also using Mockito framework…

Continue Reading... Spring JdbcNamedParameterTemplate Junit Mockito
Posted in Kafka Microservices Spring Boot

Microservices Asynchronous Communication – Push Notifications

Introduction The example I will show you here about the asynchronous communication among microservices or how microservices communicate asynchronously among themselves. A microservices-based application is a distributed system running on multiple processes or services, usually even across multiple servers or hosts. Each service instance is typically a process. Therefore, services must interact using an inter-process communication protocol such as HTTP…

Continue Reading... Microservices Asynchronous Communication – Push Notifications
Posted in Spring Boot

Spring Boot Profile Based Logging

Profile Based Logging Here in this example, I am going to show you how to create Spring Boot profile based logging. For any applications logging is an important things which will help you to debug through your application errors or issues and you can fix them easily by analyzing those errors or issues from the log files. Let’s say you…

Continue Reading... Spring Boot Profile Based Logging
Posted in Security Spring Boot Spring MVC

Spring Boot Application Over HTTPS

Introduction In this example I am going to show you how to start your spring boot application on HTTPS protocol. HTTPS is a secured protocol, whereas HTTP is unsecured protocol. So the data passed over the network using HTTPS protocol are generally encrypted data. The application which I am going to build is in the local environment and for this…

Continue Reading... Spring Boot Application Over HTTPS
Posted in Spring Boot Spring REST Spring Security

Spring Security Pre-Authentication with Spring Data JPA

Introduction In this example I am going to show you Spring Security Pre-authentication hasrole with Spring Data JPA. In my another example I had shown the similar example on Spring Security Pre-Authentication with Spring JDBC Template. There are situations where you want to use Spring Security for authorization, but the user has already been reliably authenticated by some external system…

Continue Reading... Spring Security Pre-Authentication with Spring Data JPA
Posted in Spring Boot Spring JPA Spring REST

How To Log Online User Activity In Spring Boot Applications

Introduction Here I am going to build a system to log online user activity in Spring Boot applications using HandlerInterceptor interface. As an application owner you may want to track your user activities, such as, which page they are accessing, from where requests were made to your application, from which pages to which pages they are moving, etc. If your…

Continue Reading... How To Log Online User Activity In Spring Boot Applications