Java 7 – try-with-resources Statement

Java 7 provides a new approach for closing resources with clean & clear code by try-with-resources statment. In the article, JavaSampleApproach will introduce the benifit when programming by try-with-resources statement.

Related Post: Understand Java Exception & The effect to Java Program (Single & Multi Thread)

[Continue reading…] “Java 7 – try-with-resources Statement”

How to create a SpringBoot Gemfire RestfulApi

Spring Data REST provides a mechanics for creating and retrieving an Object from Gemfire storage.
In the article, JavaSampleApproach will introduce you how to create a Gemfire RestfulAPI.

Related Articles:
How to start Embedded Gemfire Application with SpringBoot
Infinispan Cache Solution | Spring Cache | Spring Boot

[Continue reading…] “How to create a SpringBoot Gemfire RestfulApi”

How to integrate Http Angularjs with Spring MVC | Spring Boot

$http is an AngularJS service for communication with remote servers. In the article, JavaSampleApproach will show you way to integrate Http AngularJs and Spring Boot.

Related Articles:
How to configure AngularJs – SpringBoot
How to integrate Angular 4 with SpringBoot Web App and SpringToolSuite
MultipartFile – How to create Spring AngularJs MultipartFile application to download/upload files | SpringBoot + AngularJs + Bootstrap.

[Continue reading…] “How to integrate Http Angularjs with Spring MVC | Spring Boot”

How to start Embedded Gemfire Application with SpringBoot

Gemfire is a memory caching solution for scaling software system, JavaSampleApproach will guide you how to create an Embedded Gemfire Application with SpringBoot.

Related article:
Infinispan Cache Solution | Spring Cache | Spring Boot
How to create a SpringBoot Gemfire RestfulApi

[Continue reading…] “How to start Embedded Gemfire Application with SpringBoot”

Spring Boot Unit Test for Spring MVC Controller

Spring provides powerful features to make controller tests by creating request and receiving response without need of deploying code to a web container. This tutorial introduces Spring Boot Unit Test for Spring MVC Controller.

Related posts:
UnitTest – Maven skip test with SpringBoot
@DataJPATest with Spring Boot
How to use Spring JPA MySQL | Spring Boot

[Continue reading…] “Spring Boot Unit Test for Spring MVC Controller”

Java 8 Base64

Java 8 Base64 provides a standard way to do Base64 encoding and decoding.
There are three types of Base64 encoding:
Basic: Encoder produces a set of characters within A-Za-z0-9+/. Decoder rejects any character NOT mapped to A-Za-z0-9+/.
URL: Encoder produces a URL or safe filename which is set of characters within A-Za-z0-9+_.
MIME: Output is mapped to MIME friendly format.

[Continue reading…] “Java 8 Base64”

Java 8 Multiple CompletableFutures

In previous posts, we have concept of how to use CompletableFutures. This tutorial is about combining multiple CompletableFutures, it is one of the most important and useful abilities of Java 8 asynchronous processing.

Related articles:
Java Future
CompletableFutures
CompletableFuture Handle Exception

[Continue reading…] “Java 8 Multiple CompletableFutures”

How to configure AngularJs with Spring MVC | SpringBoot

AngularJS is a JavaScript framework, extends HTML and very strong for Single Page Applications. In the tutorial AngularJs SpringBoot, JavaSampleApproach will guide you how to integrate Angularjs with Spring Boot.

Related articles:
How to integrate Http Angularjs with Spring MVC | Spring Boot
How to integrate Angular 4 with SpringBoot Web App and SpringToolSuite

[Continue reading…] “How to configure AngularJs with Spring MVC | SpringBoot”

Java 8 CompletableFuture Handle Exception

Exception handling is important in software development, Java 8 CompletableFuture also provides methods to handle errors when they occurs.

Related article:
Java Future
Java 8 CompletableFuture
Java 8 Multiple CompletableFutures

[Continue reading…] “Java 8 CompletableFuture Handle Exception”

Java 8 CompletableFutures

Java 8 multithreading programming has an important feature named CompletableFuture.
In previous post about Java Future, we have the concept of a Future object, which can help us make something done while waiting for other things. However, although we can inspect Future objects to see if they’re done, what if we wanna execute some code whenever its ready? We still have to wait until the result is available.

CompletableFuture meets the requirement, and more than that.

Related articles:
Java Future
CompletableFuture Handle Exception
Java 8 Multiple CompletableFutures

[Continue reading…] “Java 8 CompletableFutures”

Java Future

In multithreaded programming, Java Future with Callable is very important for tasks which we want to know status and get the returned object.

This article give us an example for how to work with Future and Callable inside.

Related Articles:
Java Thread Pool – ExecutorService
Java 8 CompletableFutures
Java 8 CompletableFuture Handle Exception
Java 8 Multiple CompletableFutures

[Continue reading…] “Java Future”

Spring Security – Customize Authentication Provider

In the article, JavaSampleApproach will guide you how to customize Authentication Provider with Spring Security support.

Related Articles:
Spring Security – Config Security for Web MVC by Spring Boot
Spring Security – Customize Login Handler
Spring Security Customize Logout Handler
How to use Spring Security JDBC Authentication with PostgreSQL & Spring Boot

[Continue reading…] “Spring Security – Customize Authentication Provider”