Home » Enterprise Java » spring

spring

File Upload and Database Persistence with Spring Framework

Spring Mvc framework provides an out of box support for the file upload functionality in any application. In this tutorial, we will show how to implement the file upload functionality with the Spring MVC framework and saving the file attachment in the database. To handle the file uploads capabilities in a web application, spring provides a MultipartResolver bean which is ...

Read More »

Spring Caching Tutorial

Caching is crucial for today’s high-performance hungry applications. Adding Caching in a spring based application is rather trivial. In this tutorial, we will show you how to enable the data caching in a spring application by integrating the application with the popular EhCache framework. Table Of Contents 1. Introduction 1.1 Spring Framework 1.2 Spring Cache 1.3 EhCache 2. Spring Cache ...

Read More »

Spring Setter Injection Example

One of the most important development principles of the modern software design is the Dependency Injection (DI) which quite naturally flows out of another critically important principle called Modularity. This tutorial will explore a specific type of DI technique within the spring framework called Setter-Based Dependency Injection which simply injects the dependent objects into the client using a setter method. ...

Read More »

Spring Batch Step by Step Example

Spring Batch is a lightweight, comprehensive batch framework designed to enable the development of the robust batch applications vital for the daily operations of the enterprise systems. In this post, we will create a simple Spring batch tutorial to read the data from the CSV to an XML file. Table Of Contents 1. Introduction 1.1 Spring Framework 1.2 Spring Batch ...

Read More »

Spring Constructor Injection Example

One of the most important development principles of the modern software design is the Dependency Injection (DI) which quite naturally flows out of another critically important principle called Modularity. This tutorial will explore a specific type of DI technique within the spring framework called Constructor-Based Dependency Injection which simply puts the required components into a class at the time of ...

Read More »

Sending Email With Spring MVC Example

Spring provides the first-class support for sending emails. It comes with the utility libraries which abstracts away the complexities of the underlying mailing system and provides a simple API to use in the application for sending emails. In this tutorial, we will show how to write a simple Web application for sending an email based on the Spring MVC framework ...

Read More »

Spring NamespaceHandler Example

This article will discuss one of the most common configuration problems in the spring framework i.e. ‘A namespace handler for one of the spring namespaces is not found’. Most of the times, this means that one particular spring jar is missing from the classpath. So, let’s go over what these missing schemas might be, and what the missing dependency is ...

Read More »

Spring JdbcTemplate CRUD Operations Tutorial

Spring JdbcTemplate is a powerful mechanism to connect to the database and execute SQL queries. In this tutorial, we will discuss the Spring JdbcTemplate and we will cover all the CRUD operations. Table Of Contents 1. Introduction 1.1 Spring Framework 1.2 Why to use Spring Jdbc Template? 1.3 Spring Jdbc 1.4 CRUD Operations 1.5 Download and Install MySQL 2. Spring ...

Read More »

Using MockRestServiceServer to Test a REST Client

This article is an example in using MockRestServiceServer to test a REST client. MockRestServiceServer is a part of the Spring library for testing. It is the main entry point for client-side REST testing. It provides mock responses from expected requests through the RestTemplate. It eliminates the use of an actual server and thus speeds up the testing process. With its ...

Read More »

Spring Framework GraphQL Tutorial

GraphQL is a relatively new concept from Facebook that is billed as an alternative to REST for Web APIs. This article will give an introduction to setting up a GraphQL server using Spring Boot so that it can be added to the existing applications or it can be used in new ones. Table Of Contents 1. Introduction 1.1 Spring Framework ...

Read More »