RESTful Web Services

In this lesson, you will learn how to read URL query string parameters in your Spring MVC web application.   @RequestParam annotation Let’s assume that we need to create a method that needs to return a list but is limited to a certain number. To make our method read URL Query String Parameters, we will…

Read More Spring Web MVC – Reading URL Query String Parameters

In this tutorial, you will learn how to read URI path variables in your Spring MVC Web application. Define Path Variable To define the path variable in the URI path, we use curly brackets. The @GetMapping annotation below specifies one path variable called userId. Notice that userId is surrounded by curly brackets. @GetMapping(path=”/users/{userId}”) @PathVariable Annotation…

Read More Spring Web MVC – Reading URI Path Variables

In this tutorial, you will learn how to pass information from your Controller class to the View using the Spring MVC ModelAndView object. In previous lessons, we discussed how to use Model and ModelMap for the same purpose – to pass properties from Controller to the View.  The ModelAndView class, you will also use to pass…

Read More Spring Web MVC – The ModelAndView Object

In this tutorial, you will learn to configure your Spring Boot Web MVC application support Thymeleaf templates. Thymeleaf Maven Dependency To make your Spring Boot Web MVC application support Thymeleaf templates, you will need to add one additional dependency to the pom.xml file. <!– https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-thymeleaf –> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-thymeleaf</artifactId> </dependency> Templates Folder In the Spring…

Read More Spring Web MVC – Configure Thymeleaf Support

In this tutorial, you will learn how to configure the Spring Boot Web MVC application to support JSP(Java Server pages) and JSTL(JSP Standard Tag Library). Video Tutorial Maven Dependencies To configure your Spring Boot application to support Spring MVC, JSP and JSTL add the following maven dependencies to the pom.xml file. Spring Web The following…

Read More Spring Web MVC – Configure JSP Support

This tutorial is a high-level overview of the Spring Web MVC framework. Below is a high-level diagram of how things work in a Spring MVC Web application built with Spring Boot.    Most online tutorials or books will show you a similar diagram that is designed around the Dispatcher Servlet. Because this Dispatcher servlet is…

Read More Spring Web MVC – Overview for Beginners

Internationalization (i18n) is the process of making your application and services capable of delivering in different languages. This tutorial will show how the Spring Boot framework manages internationalization. Overview The internet has become global, implying that any application or website can target millions of users worldwide. Although half of the world’s population may have access…

Read More Spring MVC Internationalization Tutorial

An important property of modern web apps is Resilience. In simple words, resilience is the ability of a system’s feature to fail gracefully without impacting the entire system. In the case of web apps, we want to ensure that the entire system will not be down if a remote service (a database, API Server) fails…

Read More Enforcing Resilience in a Spring Boot App using Resilience4J

Multiple data source implementations are very crucial in instances where we want to secure the application from vulnerabilities such as a database failure. This will ensure that the application can still function even if part of the database went down. This tutorial will use student and course entities to demonstrate how multiple data sources can…

Read More Multiple Datasources in Spring Application

In this short tutorial, I am going to share with you how to switch your Spring Boot application, at runtime, to use a different logging level. Set Logging Level for a Package in Your App Suppose we have a Spring Boot Application with the following method in a Rest Controller class. @RestController @RequestMapping(“/users”) public class…

Read More Switch Logging Level in Spring Boot at Runtime