Multipart File Upload Client Using Spring REST Template

In this example I am going to show you how to test file upload using Spring Boot Rest Template API. You can always use any REST based testing tools, such as, Postman, Talend, etc. but when you do not have any access to such REST based client tools, for example, your organization has blocked access to such REST client tools….

Spring Boot REST API MultiValueMap Example

MultiValueMap In this example I am going to show you how to use Spring’s MultiValueMap in REST API. This MultiValueMap is similar to the Jersey’s MultivaluedMap. A MultiValueMap<K, V> or MultivaluedMap<K, V> is a map of key-values pairs. Each key can have zero or more values, where K – the type of keys maintained by this map and V – the type of mapped values. This…

Caching Using Hazelcast In Spring Boot REST API

Table of Contents Introduction Prerequisites Project Setup MySQL Table Application Properties Entity Class Repository Interface Service Class REST Controller Spring Boot Main Class Testing Hazelcast Caching Java Config for Hazelcast Source Code Introduction In this tutorial I am going to show you an example on caching using hazelcast in Spring Boot REST APIs. The cache or caching mechanism is used…

Spring RestTemplate With Auth Token, Proxy and Timeout

Introduction Here I am going to tell you how to use proxy server and timeout with Spring Boot RestTemplate API. If you are running your application behind a proxy server then you need to connect to REST API through proxy server and without proxy server connection you may face connection timeout error or other errors. Remember if you are behind the proxy…

Angular Spring Boot REST API CRUD Example

Introduction In this tutorial I am going to show you how to build Spring Boot Angular CRUD Application. CRUD is an acronym and stands for Create, Read, Update and Delete operations performed through an application or APIs. Using Spring Boot application I will build REST APIs which will be used to perform CRUD operations on server side resources. The Angular…

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…

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…

Call Spring REST APIs Concurrently Using Java Completable Future

REST Services In this tutorial I am going to show you how to call Spring REST APIs concurrently using Java CompletableFuture. So basically REST service APIs will be invoked parallelly and in parallel execution the response time will be very less. I am going to show you how to call REST APIs concurrently using Java 8 or later’s new feature…

Download Large File Using Spring REST API

File Download Here in this tutorial I am going to show you how to download large file using Spring REST API. Generally when you download a file, your file is stored into file system or you load it into memory as a byte array. This is not a problem when you deal with a small file but when you download…

Spring Boot AJAX jQuery to check User Availability Instantly

Introduction Here in this tutorial I am going to show you how to use AJAX technique using jQuery with Spring Boot application to check user availability instantly without refreshing the web page. I am going to use Thymeleaf template in Spring Boot application. I will use Spring REST to create REST API endpoint which will be called from jQuery code….