Spring Web MVC

This tutorial covers three distinct methods for reading application properties in a Spring Boot application. These methods include: Using the Environment object. Using the @ConfigurationProperties annotation. Using the @Value annotation. I made a simple Spring Boot Web App to show you how to read application properties. You can use the tutorial Create a Simple Web…

Read More Spring Boot: Reading Application Properties

This tutorial will teach you how to retrieve URI path variables in your Spring MVC web application. Define Path Variable To define a path variable in the URI path, we use curly brackets. For example, the @GetMapping annotation below specifies one path variable called userId, which is surrounded by curly brackets. @GetMapping(path=”/users/{userId}”) @PathVariable Annotation To…

Read More Spring MVC: Reading URI Path Variables

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 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