Introduction to Spring and Spring MVC/REST

Spring provides an evolutionary advance of the Spring powerful capabilities. This course introduces these capabilities, as well as providing guidelines on when and how to use them. It includes coverage of the three main configuration styles: Java-based (@Configuration), annotation-based (@Component), and the traditional XML-based configuration that may still play an important role in existing and new projects.

Duration
5 days
Format
Instructor-led, in person or live online

What the course covers

Prerequisites

  • Audience: Java developers who need to work with Spring based applications
  • Prerequisites: A good working knowledge of basic Java, JDBC, and Servlets/JSP
  • The standard platform does all labs with the Eclipse IDE, and the lab instructions include detailed directions for setting up and using it. The course can be made available for all major development environments, including IBM RAD and IntelliJ.

Introduction to Spring

  • Overview of Spring Technology
  • Spring Introduction
  • Dependencies and Dependency Injection (DI)

Configuration in Depth

  • Java Based Configuration (@Configuration)
  • Integrating Configuration Types
  • Bean Scope and Lifecycle
  • Externalizing Properties
  • Profiles

Spring Boot Overview

  • maven and Spring
  • Spring Boot Structure
  • Spring POMs with Boot Parents
  • Spring Boot Starters
  • Other Capabilities

Spring Testing

  • Testing and JUnit Overview
  • Spring TestContext Framework

Spring and Spring Data with Hibernate/JPA

  • Overview of Spring database support
  • Configuring a DataSource
  • Using Spring with Hibernate
  • Using Spring with JPA
  • Spring Data Overview
  • Using Spring Data

Spring Transaction (TX) Management

  • Overview
  • Declarative TX Management (REQUIRED, etc.)
  • TX Scope and Propagation
  • Pointcut-based Configuration of Transactions

Spring Web Integration and Intro to Spring MVC

  • Java EE Web App Integration
  • ContextLoaderListener and WebApplicationContext
  • Web MVC Overview
  • Spring MVC Basics

Additional Spring MVC Capabilities

  • @ModelAttribute and Reference Data
  • Forms and Binding, Spring Form Tags
  • Sessions and @SessionAttributes
  • Validation / JSR-303

RESTful Services with Spring

  • REST Overview and Principles
  • REST and Spring MVC
  • Requests and Responses
  • Ajax Overview

Working with JSON and XML

  • Generating JSON
  • Generating XML
  • Content Negotiation

Java Clients for RESTful Services

  • Client Requirements and Spring's RestTemplate
  • getForObject() / getForEntity()
  • Other RestTemplate Methods
  • Accessing Headers / exchange()

Common REST Patterns

  • GET: Read
  • POST: Create
  • PUT: Update
  • DELETE: Delete
  • Programming on server side, and client side (with RestTemplate)

Additional New Features in Spring 5 and 6

  • Updates to Spring Core
  • WebFlux / Reactive Web Framework

[Optional] XML Specific Configuration

  • Collections - lists, sets, etc.
  • Additional Capabilities

Course dates

There are no public dates for this course yet. We also run it on request for teams. Contact us to arrange a date.