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”

Jackson to convert Java Object to/from Json String

The tutorial will guide you how to use Jackson for converting Java object to Json and vice-versa.

Related Articles:
Gson for converting Java Object to/from Json
How to convert Java Object into/from XML – with Castor & Spring Boot
How to use @JsonView to serialize/de-serialize and customize JSON format from Java Object.

[Continue reading…] “Jackson to convert Java Object to/from Json String”

Gson to convert Java Object to/from Json

The tutorial guides you how to convert Java Object to Json and vice-versa by Gson.

Related Articles:
Jackson to convert Java Object to/from Json String
How to convert Java Object into/from XML – with Castor & Spring Boot

[Continue reading…] “Gson to convert Java Object to/from Json”

Logging with SLF4J and Logback

Logging is so important in software development. In simple projects, JDK logging can be a solution, but not for enterprise applications because it lacks flexibility. This tutorial will help you know how to do logging with SLF4J and Logback.

Related Article: Logging with SLF4J

[Continue reading…] “Logging with SLF4J and Logback”

Logging with SLF4J

Logging is important in software development. There are many famous frameworks to be used for logging: Log4j, Logback, java.util.logging… If we wanna change the logging framework without affecting Java code, SLF4J is the good choice.

This tutorial writes about SLF4J with example of how to apply SLF4J in some logging frameworks.

[Continue reading…] “Logging with SLF4J”

Maven Introduction – Part 4: Maven Build LifeCycle

Maven build lifeCycle is the central concept of Maven. The sequence of phases which define the order of building and distributing artifact/project is defined with a build lifeCycle.

There are three standard lifeCycles: default, clean and site.
default handles project deployment.
clean handles project cleaning.
site handles the creation of project’s site documentation.

This tutorial will introduce these Maven build lifeCycles, relation between concepts of phases and plugin goals.

[Continue reading…] “Maven Introduction – Part 4: Maven Build LifeCycle”

Maven Introduction – Part 3: Maven Dependency Mechanism

Dependency Management is a key feature of Maven. Maven Dependencies are identified by individual artifacts such as libraries or modules. It is not too difficult to manage dependencies for just a single project but, with multi-module projects, there are many things unclear.

This tutorial introduces the Maven Dependency Mechanism by which Maven helps us control them.

[Continue reading…] “Maven Introduction – Part 3: Maven Dependency Mechanism”

Maven Introduction – Part 2: Maven Repositories and Plugins

Following previous Maven article, we will go through more Maven concepts such as Maven Repositories, Plug-ins to understand better Maven standards.

[Continue reading…] “Maven Introduction – Part 2: Maven Repositories and Plugins”

Maven Introduction – Part 1

Maven is a software project management and comprehension tool, an open source project by the Apache community. It can also model a standard structure for Java projects. With Project Object Model (POM) approach, Maven provides a uniform and radical way of understanding and building Java project, reporting and documentation with all its dependencies.

This tutorial will go through quite a few Maven concepts with Eclipse IDE so that we can have a better understanding about its standards.

[Continue reading…] “Maven Introduction – Part 1”

Spring Security – Customize Login Handler

Spring Security provides lots of API for handling our program, the tutorial will guide you how to Customize Login Handler.
For How to start with Spring Security, you can follow the link: Spring Security – Config Security for Web MVC by Spring Boot

Related Articles: Spring Security Customize Logout Handler

[Continue reading…] “Spring Security – Customize Login Handler”

Spring Security Customize Logout Handler

Spring Security provides lots of function for handling our program, the tutorial will guide you how to Customize Logout Handler.
For How to start with Spring Security, you can follow the link: Spring Security – Config Security for Web MVC by Spring Boot

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

[Continue reading…] “Spring Security Customize Logout Handler”

Spring Expression Language SpEL

Spring Expression Language (SpEL) is a powerful expression language that supports querying and manipulating an object graph at runtime.

This tutorial shows various examples of ways to use SpEL expressions with XML and annotation based configuration. We also know how to evaluate an expression using SpEL classes and interfaces.

[Continue reading…] “Spring Expression Language SpEL”

Spring JPA – Many to Many relationship

This tutorial will guide you through the steps configuring Many to Many relationship in database with Spring JPA, Spring Boot & PostgreSql.

Related articles:
How to configure Spring JPA One to One Relationship – SpringBoot
How to configure Spring JPA One to Many Relationship – SpringBoot
Spring Data Rest – How to create a RestAPIs with JPA Many-to-Many relational entities | SpringBoot + MySql + HAL Browser

[Continue reading…] “Spring JPA – Many to Many relationship”

@Resource Annotation in Spring

@Resource Annotation is used to indicate a reference to a resource, it is considered an alternative to @Autowired which is an Spring standard. Similar to Java EE 5, we can use @Resource Annotation with field injection or setter method.

This tutorial will cover those kinds of injection which will be used for matching by Name, Type or Qualifier.

[Continue reading…] “@Resource Annotation in Spring”

Java 8 Streams

Java 8 comes with some prominent features like Lambda Expressions, Method References. And Streams are also an important concept that we should comprehend.

This tutorial will help you have a deep view of Java 8 Streams: what they are, ways to create them, how they work with intermediate operations, terminal operation…

[Continue reading…] “Java 8 Streams”

Spring MongoOperations to access MongoDB

MongoDB is an open-source NoSQL document database, written using C++. This tutorial will introduce way to use Spring Boot to access MongoDB and perform CRUD operations with Spring MongoOperations.

Related Articles:
How to build SpringBoot MongoDb RestfulApi
How to use SpringData MongoRepository to interact with MongDB
SpringData MongoDB GridFsTemplate to save, retrieve, delete binary files (Image, Text files)

[Continue reading…] “Spring MongoOperations to access MongoDB”

Spring ThreadPoolTaskExecutor with Callable interface for concurrency programming

Callable is a Java interface that is an useful methodology for control multi-threading returns on concurrency development.

The tutorial will guide you to build a concurrency program with ThreadPoolTaskExecutor of Spring Framework and Callable interface.

[Continue reading…] “Spring ThreadPoolTaskExecutor with Callable interface for concurrency programming”