Create, Build, Package and Run Spring Boot Application with Docker in CentOS 7

Introduction Here in this tutorial I am going to show you how to create a simple Spring Boot application. Then how to build, package and run this Spring Boot application with Docker in Linux environment (CentOS). I am going to use both gradle and maven as build tools for running build on this Spring Boot application. In my previous tutorial I had discussed how to install docker on CentOS 7. I am not going to tell you here why do you need docker but you can read it from my…

Continue

How to install Docker on CentOS 7

Introduction I am going to show you how to install docker in Linux platform, the operating system I am using here is CentOS 7 64 bit architecture. In my previous tutorial I had shown how to install docker on Windows 7 operating system. Docker is a container, more like a virtual machine, portable, resource friendly and dependent on the host operating system. Using docker makes an application simple and easy to run in a container.

Continue

How to convert CSV File to PDF File using PyFPDF in Python

Here I am going to tell you how to convert CSV to PDF file using PyFPDF library in Java programming language. CSV is a comma separated value and it can be opened as a plain text file or in Microsoft excel file. There are few advantages of CSV data: CSV format is considered to be standard format CSV is smaller in size and faster to handle CSV is simple to implement and easy to parse CSV is human readable and easy to edit manually CSV is processed by almost all…

Continue

How to convert PDF File to CSV File using iText API in Java

In this example I going to show you how to convert PDF file to CSV file. I will read the PDF file using iText library and write data to the CSV file using Java programming language. In my previous example I had shown how to convert CSV file to PDF file using iText library. As you know that CSV is a comma separated value, so I assume that the PDF file is having data in tabular format which would be converted into comma separated values. Related Posts: How to generate…

Continue

How to convert CSV file to PDF file using iText API in Java

Here I am going to tell you how to convert CSV to PDF file using iText library in Java programming language. I am going to use Java 7 or later version’s new feature Path API to read the CSV file and Java 8’s Stream API to split the comma separated line or record. I am going to show you how to read file content into byte array and how to convert byte array into String. Then I am converting the array of String into a list of String. Finally from…

Continue

Top 10 best practices while building applications using Spring framework

Introduction In this tutorial I am going to discuss about some best practices while building applications using Spring framework. Recently Spring has been one of the most popular Java based framework for building enterprise applications. Anyone can grasp the basic concepts and starts building applications using Spring right away but to become a strong developer you need to put efforts and time into it. In this tutorial we will discuss on the most common best practices to be followed while building applications using Spring framework. These common practices are discussed…

Continue

Junit Testing for Multiple Files Upload Spring REST Controller

Introduction Here I am going to write Junit test case for testing multiple files upload in Spring REST Controller. I have already created how to upload multiple files using Spring REST API and I also had shown how to test it through REST client tool – Postman. In this tutorial I am going to use Junit 5, @WebMvcTest annotation to test the multiple files upload REST API. @WebMvcTest annotation can be used not only to test Spring Controllers but also Spring REST Controllers. I will build the applications using both maven…

Continue

How include required gradle project into another project

Here I will tell you how to include the required gradle project into another project. Situation may occur when you need to have dependency of another gradle project into your current gradle project, but neither of these projects is a multi-module project. So in this case you can easily add the required project into your current working project. To include another gradle project you need to edit the settings.gradle file of the current project. In the current project’s settings.gradle file, you have to add the project’s name which you want…

Continue

How to upload multiple files using Spring REST API

Introduction Here in this tutorial I am going to tell you how to upload multiple files using Spring Boot REST API. I had also shown you in my another example how to upload single file using Spring Boot REST API framework. For uploading file(s) you can use any client, for example, browser or any REST client (Postman) that supports for uploading of files. Even you can write client side code using HTML, CSS jQuery/JavaScript or React JS, Angular etc. to upload multiple files.

Continue

Spring Asynchronous Request Processing via DeferredResult Class

Introduction I am going to discuss here how to perform asynchronous request processing via Spring’s DeferredResult class. A DeferredResult can be used when the application wants to produce the return value from a thread of its own choice. A DeferredResult is what is possibly not-yet-finished computation that will be available in future. Spring MVC 3.2 introduced a Servlet 3 based asynchronous request processing. Normally once request processing is finished, you leave the controller handler method, but it is not the same case with DeferredResult. Spring MVC will hold on with…

Continue