Category: Spring Framework 5

Spring Web applications and services need to process client requests sent over HTTP. When the HTTP clients send data with the request, the data is in the request body. On the application side, you need a mechanism to deserialize data sent in the request body to domain objects. This is done using the @RequestBody annotation. […]Continue reading

Enterprise Applications developed using the Spring Framework use different types of configuration properties to configure the application at runtime. These configuration properties help in connecting to databases, messaging systems, perform logging, caching, and lots more. It is common to store configuration properties in external .properties and .yml files. There are various ways of reading external […]Continue reading

A Spring Boot RESTful service is typically divided into three layers:  Repository, Service, and Controller. This layering helps to segregate the RESTful application responsibilities and enabling loose coupling between the objects. When you develop a layered RESTful application, you will also need to test the different layers. In this post, I will discuss testing Spring […]Continue reading

Introduction Situation Most of our applications are supported by external services such as a database server, an SMS gateway, or services such as PayPal. Such services can exist in more than one environment i.e development and production environments. If we want to connect to the production environment we must pass through the development environment first. […]Continue reading

When you start a Spring application, the Spring Framework creates beans for you. These Spring beans can be application beans that you have defined or beans that are part of the framework. When the Spring Framework creates a bean, it associates a scope with the bean. A scope defines the runtime context within which the […]Continue reading

The Spring IoC (Inversion of Control) container manages Spring beans. A “Spring bean” is just a Spring managed instantiation of a Java class. The Spring IoC container is responsible for instantiating, initializing, and wiring beans. The container also manages the life cycle of beans. Spring provides several ways through which you can tap into the […]Continue reading

Enterprise Spring applications typically need to run in multiple environments. For example, development, testing, staging, and production. Each such environment has its own set of settings. For example, you might be using an embedded H2 database for development but an enterprise-grade Oracle or MySQL database for production. So the data source and connection configurations for […]Continue reading