Custom Login Form in Spring Security

In this post, We will take a look at providing a custom form login in a spring boot application. The default spring boot form login may not fit everyone’s need. For example, Some organization may want to put a logo on their login page. Some may find the default login forms less appealing. For some perfectionists,…

Form Login with Spring Boot

This article concentrates on the default form login implementation from Spring Boot and Spring Security. Let’s dive in to understand spring security with form-based username and password login. To start with, I have written a simple web application with an API that prints hello world. There is nothing special about this Controller. When we open…

Spring Security

What is Spring Security? It is a powerful and highly customizable authentication and access-control(RBAC) framework. It is the standard for securing Spring-based web applications. This framework focuses on providing both authentication and authorization to Java applications. Similar to other modules, You can easily extend the Spring Security module to meet custom requirements. Features Here are…

Spring Boot Redis Cache

Let’s learn how to implement redis as a cache store in spring boot with an example. Previously, We discussed how to enable caching implementation in Spring Boot using an in-memory cache manager. But, there were few drawbacks to that approach. This is where the Redis cache store comes into the picture. Introduction Redis is a…

Spring Cache For Better application performance

Let’s learn how to implement cache mechanisms in Spring Boot using @Cacheable annotation with an example. Introduction to Spring Cache abstraction Caching is a concept that improves response time by storing copies of most frequently used data on a temporary but fast storage. In this article, We will see how to enable caching for a…

Command Line Runner in Spring Boot.

In this post, We will take a look at Command line runner in Spring Boot and how to implement them properly with an example. Typical Java Implementation Let’s take a small example in pure java. The above class is an example of a command line application. The application takes two command line arguments, then calculates…

Spring Boot Banner – Complete Guide

In this post, We will learn how to customize startup banner of a spring Boot application. Also, we will understand how we can use an image or gif file as a startup banner. Take a look at our Hello World Application. As you see, the default at the spring boot startup banner looks like below….

RESTful JPA Repositories with Spring Boot

In this post we will see how to create restful endpoints from JPA Repositories in a Spring Boot application. Introduction In the HATEOAS implementation tutorial, we pretty much save and retrieve data from the database. But there is too much boilerplate code for just managing the data(Controller methods). In situations like these, Spring Data REST comes…

Startup Actuator Endpoint in Spring Boot

This post will learn more about the new Startup Actuator endpoint and how we can use it to optimize the startup time of Spring Boot applications. Spring Boot startup sequence is a complex process. We can speed the Spring Boot application startup by tracking the application startup events. Till now we didn’t have an easier…

HTTP Error codes based on Exception in Spring Boot

In our previous installment, We have made sure our application follows a hypermedia format called HAL. However, At most of the controller methods, we have been throwing RuntimeException. These by design would cause 500 Error codes. But REST principles dictate that proper message or indication must be given back to the client when possible. For example,…