Spring in Action, Fifth Edition
Craig Walls
  • MEAP began July 2017
  • Publication in November 2018 (estimated)
  • ISBN 9781617294945
  • 500 pages (estimated)
  • printed in black & white

This book is the Spring developer's "swiss army knife"!

Riccardo Noviello


An eBook copy of the previous edition, Spring in Action, Fourth Edition, is included at no additional cost. It will be automatically added to your Manning Bookshelf within 24 hours of purchase.

Spring in Action, 5th Edition is the fully-updated revision of Manning's bestselling Spring in Action. This new edition includes all Spring 5.0 updates, along with new examples on reactive programming, Spring WebFlux, and microservices. You'll also find the latest Spring best practices, including Spring Boot for application setup and configuration.

Table of Contents detailed table of contents

Part 1 : Foundational Spring

1. Getting started with Spring

1.1. What is Spring?

1.2. Initializing a Spring application

1.2.1. Initializing a Spring project in Spring Tool Suite

1.2.2. Examining the Spring project structure

1.3. Writing a Spring application

1.3.1. Handling web requests

1.3.2. Defining the view

1.3.3. Testing the controller

1.3.4. Building and running the application

1.3.5. Getting to know Spring Boot DevTools

1.3.6. Let’s review

1.4. Surveying the Spring landscape

1.4.1. The Core Spring Framework

1.4.2. Spring Boot

1.4.3. Spring Data

1.4.4. Spring Security

1.4.5. Spring Integration and Spring Batch

1.4.6. Spring Cloud

1.5. Summary

2. Developing web applications

2.1. Displaying information

2.1.1. Establishing the domain

2.1.2. Creating a controller class

2.1.3. Designing the view

2.2. Processing form submission

2.3. Validating form input

2.3.1. Declaring validation rules

2.3.2. Performing validation at form binding

2.3.3. Displaying validation errors

2.4. Working with view controllers

2.5. Choosing a view template library

2.5.1. Caching templates

2.6. Summary

3. Working with data

3.1. Reading and writing data with JDBC

3.1.1. Adapting the domain for persistence

3.1.2. Working with JdbcTemplate

3.1.3. Defining a schema and preloading data

3.1.4. Inserting data

3.2. Persisting data with Spring Data JPA

3.2.1. Adding Spring Data JPA to the project

3.2.2. Annotating the domain as entities

3.2.3. Declaring JPA repositories

3.2.4. Customizing the JPA repositories

3.3. Summary

4. Securing Spring

4.1. Enabling Spring Security

4.2. Configuring Spring Security

4.2.1. In-memory user store

4.2.2. JDBC-based user store

4.2.3. LDAP-backed user store

4.2.4. Customizing user authentication

4.3. Securing web requests

4.3.1. Securing requests

4.3.2. Creating a custom login page

4.3.3. Logging out

4.3.4. Preventing cross-site request forgery

4.4. Knowing your user

4.5. Summary

5. Working with configuration properties

5.1. Fine-tuning auto-configuration

5.1.1. Understanding Spring’s environment abstraction

5.1.2. Configuring a data source

5.1.3. Configuring the embedded server

5.1.4. Configuring logging

5.1.5. Using special property values

5.2. Creating your own configuration properties

5.2.1. Defining configuration properties holders

5.2.2. Declaring configuration property metadata

5.3. Configuring with profiles

5.3.1. Defining profile-specific properties

5.3.2. Activating profiles

5.3.3. Conditionally creating beans with profiles

5.4. Summary

Part 2 : Integrated Spring

6. Creating REST services

6.1. Writing RESTful Controllers

6.1.1. Retrieving data from the server

6.1.2. Sending data to the server

6.1.3. Updating data on the server

6.1.4. Deleting data from the server

6.2. Enabling hypermedia

6.2.2. Creating resource assemblers

6.2.3. Naming embedded relationships

6.3. Enabling data-backed services

6.3.1. Adjusting resource paths and relation names

6.3.2. Paging and sorting

6.3.3. Adding custom endpoints

6.4. Summary

7. Consuming REST services

7.1. Consuming REST endpoints with RestTemplate

7.1.1. GETting resources

7.1.2. PUTting resources

7.1.3. DELETEing resources

7.1.4. POSTing resource data

7.2. Navigating REST APIs with Traverson

7.3. Summary

8. Sending messages asynchronously

8.1. Sending messages with JMS

8.1.1. Setting up JMS

8.1.2. Sending messages with JmsTemplate

8.1.3. Receiving JMS messages

8.2. Working with RabbitMQ and AMQP

8.2.1. Adding Rabbit to Spring

8.2.2. Sending messages with RabbitTemplate

8.2.3. Receiving message from RabbitMQ

8.3. Messaging with Kafka

8.3.1. Setting up Spring for Kafka messaging

8.3.2. Sending messages with KafkaTemplate

8.3.3. Writing Kafka listeners

8.4. Summary

9. Integrating Spring

9.1. Declaring a simple integration flow

9.1.1. Defining integration flows with XML

9.1.2. Configuring integration flows in Java

9.1.3. Using Spring Integration’s DSL configuration

9.2. Surveying the Spring Integration landscape

9.2.1. Message channels

9.2.2. Filters

9.2.3. Transformers

9.2.4. Routers

9.2.5. Splitters

9.2.6. Service activators

9.2.7. Gateways

9.2.8. Channel adapters

9.2.9. Endpoint modules

9.3. Creating an email integration flow

9.4. Summary

Part 3 : Reactive Spring

10. Introducing Reactor

10.1. Understanding reactive programming

10.1.1. Defining Reactive Streams

10.2. Getting started with Reactor

10.2.1. Diagramming reactive flows

10.2.2. Adding Reactor dependencies

10.3. Applying common reactive operations

10.3.1. Creating reactive types

10.3.2. Combining reactive types

10.3.3. Transforming and filtering reactive streams

10.3.4. Performing logic operations on reactive types

10.4. Summary

11. Developing reactive APIs

11.1. Working with Spring WebFlux

11.1.1. Introducing Spring WebFlux

11.1.2. Writing reactive controllers

11.2. Defining functional request handlers

11.2.1. Handling realistic requests

11.3. Testing reactive controllers

11.3.1. Testing GET requests

11.3.2. Testing POST requests

11.3.3. Testing with a live server

11.4. Consuming REST APIs reactively

11.4.1. GETting resources

11.4.2. Sending resources

11.4.3. Deleting resources

11.4.4. Handling errors

11.4.5. Exchanging requests

11.5. Securing reactive web APIs

11.5.1. Configuring reactive web security

11.5.2. Configuring a reactive user details service

11.6. Summary

12. Persisting data reactively

12.1. Understanding Spring Data’s reactive story

12.1.1. Spring Data reactive distilled

12.1.2. Converting between reactive and non-reactive types

12.1.3. Developing reactive repositories

12.2. Working with reactive Cassandra repositories

12.2.1. Enabling Spring Data Cassandra

12.2.2. Understanding Cassandra data modeling

12.2.3. Mapping domain types for Cassandra persistence

12.2.4. Writing reactive Cassandra repositories

12.3. Writing reactive MongoDB repositories

12.3.1. Enabling Spring Data MongoDB

12.3.2. Mapping domain types to documents

12.3.3. Writing reactive MongoDB repository interfaces

12.4. Summary

Part 4 : Cloud-Native Spring

13. Discovering services

13.1. Thinking in microservices

13.2. Setting up a service registry

13.2.1. Enabling a Eureka server

13.2.2. Configuring Eureka

13.2.3. Scaling Eureka

13.3. Registering and discovering services

13.3.1. Configuring Eureka client properties

13.3.2. Consuming services

13.4. Summary

14. Managing configuration

14.1. Sharing configuration

14.2. Running a configuration server

14.2.1. Enabling Config Server

14.2.2. Populating the configuration repository

14.3. Consuming shared configuration

14.4. Serving application- and profile-specific properties

14.4.1. Serving application-specific properties

14.4.2. Serving properties from profiles

14.5. Keeping configuration properties secret

14.5.1. Encrypting properties in Git

14.5.2. Storing secrets in Vault

14.6. Refreshing configuration properties on-the-fly

14.6.1. Manually refreshing configuration properties

14.6.2. Automatically refreshing configuration properties

14.7. Summary

15. Handling failure and latency

15.1. Understanding circuit breakers

15.2. Declaring circuit breakers

15.2.1. Mitigating latency

15.2.2. Managing circuit breaker thresholds

15.3. Monitoring failures

15.3.1. Understanding Hystrix thread pools

15.4. Aggregating multiple Hystrix streams

15.5. Summary

Part 5 : Deployed Spring

16. Working with the Spring Boot Actuator

16.1. Introducing the Actuator

16.1.1. Configuring the Actuator’s base path

16.1.2. Enabling and disabling Actuator endpoints

16.2. Consuming Actuator endpoints

16.2.1. Fetching essential application information

16.2.2. Viewing configuration details

16.2.3. Viewing application activity

16.2.4. Tapping runtime metrics

16.3. Customizing the Actuator

16.3.1. Contributing information to the /info endpoint

16.3.2. Defining custom health indicators

16.3.3. Registering custom metrics

16.3.4. Creating custom endpoints

16.4. Securing the Actuator

16.5. Summary

17. Administering Spring

17.1. Using the Spring Boot Admin

17.1.1. Creating an Admin Server

17.1.2. Registering admin clients

17.2. Exploring the admin server

17.2.1. Viewing general application health and information

17.2.2. Watching key metrics

17.2.3. Examining environment properties

17.2.4. Viewing and setting logging levels

17.2.5. Monitoring threads

17.2.6. Tracing HTTP requests

17.3. Securing the Admin Server

17.3.1. Enabling login in the Admin Server

17.3.2. Authenticating with the Actuator

17.4. Summary

18. Monitoring Spring with JMX

18.1. Working with Actuator MBeans

18.2. Creating your own MBeans

18.3. Sending notifications

18.4. Summary

19. Deploying Spring

19.1. Weighing deployment options

19.2. Building and deploying WAR files

19.3. Pushing JAR files to CloudFoundry

19.4. Running Spring Boot in a Docker container

19.5. The end is where we begin

19.6. Summary


Appendix A: Bootstrapping Spring applications

A.1. Initializing a project with Spring Tool Suite

A.2. Initializing a project with IntelliJ IDEA

A.3. Initializing a project with NetBeans

A.4. Initializing a project at start.spring.io

A.5. Initializing a project from the command line

A.5.1. curl and the Initializr API

A.5.2. Spring Boot command-line interface

A.6. Initializing a project with Atomist

A.7. Creating Spring applications with a meta-framework

A.8. Building and running projects

About the Technology

Spring Framework has been making Java developers more productive and successful for over a dozen years, and it shows no signs of slowing down! The most-recent version, Spring 5.0, adds numerous features, including better support for reactive applications, cloud-native development, and microservices. Now that Spring Boot is fully integrated into the framework, you can focus on your application's functionality with a significant reduction in the amount of framework-specific configuration and code you need to manage.

About the book

Written in author Craig Walls' famously-clear style, this easy-to follow guide starts with a quick tutorial on Spring's core features. Then, you'll dive straight in as you build a secure database-backed web app. You'll learn integration via a REST API, reactive programming, the pros and cons of microservices, service discovery, deployment, and more. Whether you're just discovering Spring or looking to onboard the latest features, there's no better way to master Spring than with this book!

What's inside

  • Developing reactive applications with Spring
  • Building applications with Spring and Spring Boot
  • Spring MVC for web apps and RESTful web services
  • Writing Spring-enabled data repositories
  • Securing your applications with Spring Security
  • Working with cloud-native apps

About the reader

Written for intermediate Java developers.

About the author

Craig Walls is a software developer at Pivotal. He's a popular author and frequent speaker at user groups and conferences.

Manning Early Access Program (MEAP) Read chapters as they are written, get the finished eBook as soon as it’s ready, and receive the pBook long before it's in bookstores.
Spring in Action, Fifth Edition (combo) added to cart
continue shopping
go to cart

MEAP combo $49.99 pBook + eBook + liveBook
Spring in Action, Fifth Edition (eBook) added to cart
continue shopping
go to cart

MEAP eBook $39.99 pdf + ePub + kindle + liveBook

FREE domestic shipping on three or more pBooks

Sets the stage for the next generation of Spring development.

John Gunvaldson

This is a great way to learn the benefits of creating application using Spring Boot.

David Witherspoon