Jetty with Spring Boot – Replacing tomcat with Jetty

Let’s learn how to change the default tomcat server with a jetty server in Spring boot with detailed instructions. Tomcat and Jetty are the most known web servers in Java. They both have identical features and have the same set of features to offer. Even though I personally prefer tomcat, there are ways to update…

Whitelabel Error Page in Spring Boot | Complete Guide

Let’s learn about the Whitelabel error page in Spring Boot and how to customize or disable them. White label error pages are default behavior from Spring Boot. Like any other feature, We can customize this feature to great extent. What are Whitelabel error pages in Spring Boot? Depending on API client request or browser request,…

Customizing Exit Codes of a Spring Boot Application

Let’s take a look at exit codes in Spring boot and the various ways we can customize them. What is an Exit Code? In the UNIX shell, An exit code or sometimes known as a return code is a number from 0 to 255 by a process or an executable. These codes let the caller…

Spring Boot Database Initialization

Let’s learn all about database initialization in spring boot. We can create and populate a database in different ways. Even though it is common to do this manually, an automatic approach is not a bad thing. For example, Spring Boot offers Schema and Data initialization through the JPA module. We can control this behavior using…

Export to CSV file using Spring Boot

In this post, let’s look at how easy it is to export information from the database to a CSV file using Spring Boot and JPA. For this example, We are going to download data from tables using Spring JPA and write the response as CSV. Approach To demonstrate the export of data into a CSV…

OpenCSV for Reading and Writing CSV file in Java

Let’s take a look at reading and writing CSV files in java using OpenCSV with a few examples. First of all, OpenCSV is a CSV file (comma-separated values) parser library for Java. Unlike Apache Commons CSV library, this library is for advanced users who can deal with a little bit of config. Adding OpenCSV to Java…

Apache Commons CSV to Read and Write CSV files in Java

Let’s take a look at reading and writing CSV files in java using Apache Commons CSV with a few examples. First, you might ask why we need a library when we can write CSV files using pure java. To some extent you are right. However, you would need a library as your custom written reader/writer…

Using Java to write Data into CSV files

Creating and writing CSV files is easier than you think with Java. CSV stands for Comma Separated Values. As the name suggests, We just need to write values separated by a comma on each line to create such a file. Identify the data you want to write as CSV For example, You have an Array…

Introduction to WebSocket with Spring Boot

Let’s take a look at how to add WebSocket support to a spring boot application. We will try to create a simple chat application. Note that this implementation does not use STOMP. What is WebSocket? The WebSocket protocol helps in establishing a full-duplex two-way communication between client and server over a single TCP connection. This…

Drools Rule Engine

Overview Drools Rule Engine is a Business Rules Management System (BRMS) solution. Some people also consider drool as a Business Logic integration Platform (BLiP). It provides the following features. Core Business Rules Engine (BRE), Drools Workbench (A rule authoring web application) Support for Decision Model and Notation (DMN)  Eclipse IDE plugin for core development. Drools has…