How to use Spring Factory Method to create Spring Bean

Spring Framework provides Spring Factory Method mechanics to create Beans from static(non-static) method of a Factory Class in XML config files. In the tutorial, JavaSampleApproach will introduce Spring Factory Method with sample codes.

Related Posts:
How to inject Collection in Spring
Inject Properties from Properties File using Spring Environment

[Continue reading…] “How to use Spring Factory Method to create Spring Bean”

Spring Batch Partition for Scaling & Parallel Processing

For Scaling & Parallel Processing, Spring Batch provides various solutions: Multi-threaded Step, Parallel Steps, Remote Chunking of Step & Partitioning a Step. In the tutorial, JavaSampleApproach will introduce Partitioning a Step cleary by a sample project.

Related articles:
Spring Batch Job with Parallel Steps
How to use Spring Batch Late Binding – Step Scope & Job Scope

[Continue reading…] “Spring Batch Partition for Scaling & Parallel Processing”

Spring @RequestAttribute annotation – Spring MVC

Spring 4.3 provides a new @RequestAttribute annotation that helps us access to pre-existing global request attributes (outside the controller). Today we’re gonna look at how to get a HttpServletRequest attribute which is created in an Interceptor using Spring @RequestAttribute annotation.

Related Articles:
How to use SpringMVC HandlerInterceptor with Spring Boot
Spring @SessionAttribute annotation – Spring MVC

[Continue reading…] “Spring @RequestAttribute annotation – Spring MVC”

Spring @SessionAttribute annotation – Spring MVC

Spring 4.3 provides a new @SessionAttribute annotation that helps us access to pre-existing global session attributes (outside the controller). Today we’re gonna look at how to get a HttpSession attribute which is created in an Interceptor using Spring @SessionAttribute annotation.

Related Articles:
How to use SpringMVC HandlerInterceptor with Spring Boot
Spring @RequestAttribute annotation – Spring MVC

[Continue reading…] “Spring @SessionAttribute annotation – Spring MVC”

How to use Spring Batch Late Binding – Step Scope & Job Scope

Spring Batch Late Binding provides a solution for late binding Job’s Parameters with Beans’ properties. In the tutorial, JavaSampleApproach will introduce Spring Batch Late Binding cleary by a sample project.

Related Articles:
1. How to use Spring Batch Inheritance function
2. How to use Intercepting Job Execution in Spring Batch
3. How to start with Spring Batch using Spring Boot – Java Config
4. Spring Batch Partition for Scaling & Parallel Processing

[Continue reading…] “How to use Spring Batch Late Binding – Step Scope & Job Scope”

Spring Bean Scope Annotation: @RequestScope | @SessionScope | @ApplicationScope

Spring Framework new release 4.3 make some Web Improvements. Among that, it simplifies way to implement Bean Scopes (Request, Session and Application scopes) using Annotation: @RequestScope | @SessionScope | @ApplicationScope. They are only valid in the context of a web-aware Application.

Related Articles:
Spring Bean Scope – Singleton and Prototype
Spring Bean Scope using Annotation – Singleton, Prototype, Request, Session, Global Session, Application

[Continue reading…] “Spring Bean Scope Annotation: @RequestScope | @SessionScope | @ApplicationScope”

How to use Spring Batch Inheritance function

In the tutorial, JavaSampleApproach will introduce about inheritance feature of Spring Batch: Inheriting from a Parent Job & Inheriting from a Parent Step.

Related post:
How to use Intercepting Job Execution in Spring Batch

[Continue reading…] “How to use Spring Batch Inheritance function”

How to use Intercepting Job Execution in Spring Batch

For Intercepting Job Execution feature, Spring Batch provides an interface called JobExecutionListener to notify events in a Job lifecycle. So in the tutorial, JavaSampleApproach will guide how to configure Intercepting Job Execution with JobExecutionListener.

Related Posts:
1. How to start with Spring Batch using Spring Boot – Java Config
2. Spring Batch XML Config by Spring Boot
3. How to use Spring Batch Inheritance function

[Continue reading…] “How to use Intercepting Job Execution in Spring Batch”

How to use @RestControllerAdvice for handling Exception with RestfulApi – New Features of Spring Framework 4.3

We had discussed about @ExceptionHandler, @ResponseStatus, @ControllerAdvice in How to use Spring Exception Handler for SpringMVC: @ExceptionHandler, @ResponseStatus, @ControllerAdvice. In the tutorial, JavaSampleApproach will guide to how to use a new feature of Spring Framework 4.3: @RestControllerAdvice.

[Continue reading…] “How to use @RestControllerAdvice for handling Exception with RestfulApi – New Features of Spring Framework 4.3”

How to use Spring Exception Handler for SpringMVC: @ExceptionHandler, @ResponseStatus, @ControllerAdvice

Spring provides a cross-cutting concern solution for handling Java Excepion. So in the tutorial, JavaSampleApproach will guide how to use Spring Exception with: @ResponseStatus, @ExceptionHandler & @ControllerAdvice.
Related Articles:
How to handle Java Exception
How to use @RestControllerAdvice – New Features of Spring Framework 4.3

[Continue reading…] “How to use Spring Exception Handler for SpringMVC: @ExceptionHandler, @ResponseStatus, @ControllerAdvice”

How to create paging and sorting results with Spring JPA and PostgreSQL | Spring Boot

Spring Data with Spring JPA supports the ways to write interface for repositories and custom finder methods. Pagination is so important in case we have many data records to show.

In this tutorial, we’re gonna look at the way to make paging and sorting results with Spring JPA and PostgreSQL using Spring Boot.

Related articles:
How to use Spring JPA MySQL | Spring Boot
How to use Spring JPA with PostgreSQL | Spring Boot
@DataJPATest with Spring Boot

[Continue reading…] “How to create paging and sorting results with Spring JPA and PostgreSQL | Spring Boot”

How to change logging level with the MVC endpoint – new Actuator Loggers Endpoint | Spring Boot

Spring Boot 1.5.1 provides some new features. Among them, we have a new actuator loggers endpoint, which helps us to view and change logging level of application with the MVC endpoint.

This tutorial shows you the way to do this with http GET/POST request.

[Continue reading…] “How to change logging level with the MVC endpoint – new Actuator Loggers Endpoint | Spring Boot”

How to start with JSP page and static resource in Spring Boot

In Java Web Application Development, JSP page and static resource (css file, javascript file) are two of the most important thing to start. This tutorial shows you how to embed them into a Spring Boot application.

[Continue reading…] “How to start with JSP page and static resource in Spring Boot”

How to use Spring Integration Http Outbound Gateway for Polling a http end point with GET method

Spring Integration provides Http Outbound Components for polling a Http Endpoints with: Http Outbound Gateway & Http Outbound Adapter.
Http Outbound adapter: just send requests to an http endpoint.
– But Http Outbound gateway: send requests to an http endpoint then return responses.
In the tutorial, JavaSampleApproach will guide you how to poll a http end point with Get request by Http Outbound Gateway.

Related Posts:
1. How to use Spring Integration Http Inbound with Spring Boot
2. How to start Spring Integration with Spring Boot

[Continue reading…] “How to use Spring Integration Http Outbound Gateway for Polling a http end point with GET method”

How to define template for multipage with Apache Tiles in Spring Boot

In the previous post, we have started with Apache Tiles. We know the way to define page fragments (each fragment as a tile) and combine them into a larger page (as a root with many tiles).

This tutorial introduces a way to define template for multipage with Apache Tiles in Spring Boot.

[Continue reading…] “How to define template for multipage with Apache Tiles in Spring Boot”

How to start with Apache Tiles in Spring Boot

Apache Tiles allows us to define page fragments (each fragment as a tile) which can be combined into a larger page (as a root with many tiles). They help to reduce duplication of common content, so that we can make a series of reusable templates more easier.

This tutorial shows you how to start with Apache Tiles in Spring Boot.

[Continue reading…] “How to start with Apache Tiles in Spring Boot”

Spring Security – JDBC Authentication – SpringBoot + MySQL + Bootstrap

In the tutorial, JavaSampleApproach will show you how to create a Spring Security JDBC Authentication with SpringBoot + MySQL + Bootstrap.

[Continue reading…] “Spring Security – JDBC Authentication – SpringBoot + MySQL + Bootstrap”

Spring Security – JDBC Authentication – SpringBoot + PostgreSQL + Bootstrap

In the tutorial, JavaSampleApproach will show you how to create a Spring Security JDBC Authentication with SpringBoot + PostgreSQL + Bootstrap.

[Continue reading…] “Spring Security – JDBC Authentication – SpringBoot + PostgreSQL + Bootstrap”