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

How to resize bulk images using PHP

Here in this tutorial I am going to show you how to resize multiple images or bulk images using PHP programming language. I am going to use built-in functions from PHP language to scan the directory and resize images. Such functions are scandir(), imagecreatetruecolor(), imagecreatefromjpeg(), imagecopyresized() and imagejpeg(). In this example I am going to scan a particular directory that contains bulk images and one by one I will resize and save the image in the same directory. So the original image will be replaced by the resized image. If…

Continue

How to create and consume SOAP web service using SoapServer and SoapClient in PHP

In this tutorial I am going to show you how to create SOAP web service using SoapServer and how to consume web service using SoapClient in PHP. I am going to create a WSDL or web service definition language file for defining the contract between the server and client. SoapServer is used to create server side implementation of the SOAP service, whereas SoapClient is to used to consume the SOAP service.

Continue

3 ways to consume SOAP web service in PHP

Here I am going to show you how to consume SOAP web service in PHP in 3 ways. To consume SOAP webservice you must have a SOAP web service deployed onto a server. Here I am going to consume or call the SOAP service which is ready made available on the internet. I am calling the CelsiusToFahrenheit which converts temperature from celsius to fahrenheit. You may also create your own service and write a SOAP client to consume the service. The method of consumption is similar to what I am…

Continue

PHP SOAP Web Service Configuration

Here I am going to tell you how to configure PHP SOAP web service. Obviously you can imagine why I am going to show you PHP SOAP configuration. This is required when you are going to create or consume the SOAP web service from your PHP programs. SOAP is an acronym that stands for Simple Object Access Protocol. It is XML based messaging protocol that defines the semantic of the communication structure between two applications. It is both platform and language independent. It supports various protocols while communicating to different…

Continue