Spring 4 Advanced

This course is currently not scheduled on the open calendar, but can be organized on request.

Number of days

3 day(s)

Audience

Spring developers who want to learn about the more advanced features of Spring

Prerequisites

Having followed Spring Workshop (SRP410) or having similar experience

Objectives

Explore several Spring modules and projects that enable you to implement amazing features in your applications

Methods

Classroom training with hands-on exercises

Description

The Spring framework is an excellent foundation of any Java enterprise application. As a container, it enables clean, portable, flexible and testable code, that can run anywhere you can run a Java VM. Spring also helps you to get started quickly, by eliminating XML configuration and bootstrapping the setup of your project, thanks to the Spring Boot project.

Spring is continuously exploring new ways to make difficult development tasks simpler and to pave new trails in Java EE development. It progresses into areas where Java EE is just starting or isn't innovating at all. That makes Spring the most popular and beloved framework in the Java ecosystem.

During this course we will explore several of these libraries and side projects from Spring that will help you introduce exciting new features into your applications. Do you need to guide users through several pages? Spring Web Flow is what you need. Do you want to secure access to pages and features of your application? Use Spring Security. Do you want to improve the performance? Add Spring Caching. Need interoperability? Add Spring Web Services or Spring REST. The course also introduces Spring Data REST, Websockets, task scheduling, integrating JMS and how to send emails from Spring applications. Every chapter concludes with an exercise that illustrates the steps required to configure the Spring feature and how to use it, allowing you to gain practical experience.

At the end of this course, you'll have knowledge of several interesting Spring libraries and how to apply them to your projects.

Contents

  • Spring 4 Advanced
    • Goal
    • Agenda
  • Migrating from earlier versions of Spring
    • Migrating guides
    • Reasons for migrating
    • Migration tips
  • Caching data
    • Caching
    • Caching in Spring
    • Enabling cache support
    • Configuring a cache manager
    • Caching with Ehcache
    • Caching with Redis
    • Working with multiple cache managers
    • Annotating methods for caching
    • Populating the cache
    • Customizing the cache key
    • Conditional caching
    • Removing cache entries
    • Declaring caching in XML
    • Exercise: Caching data
  • Spring Security
    • The importance of security
    • Spring Security
    • Spring Security modules
    • Filtering web requests
    • Adding Spring Security to Maven
    • The simplest configuration
    • User detail services
    • In-memory user store
    • JDBC-backed user store
    • Working with encoded passwords
    • LDAP-backed authentication
    • Configuring a custom user service
    • Intercepting requests
    • Path configuration methods
    • Securing with Spring expressions
    • Enforcing channel security
    • Preventing cross-site request forgery
    • Authenticating users
    • Adding a custom login page
    • Enabling HTTP Basic authentication
    • Enabling remember-me functionality
    • Logging out
    • Securing the view
    • Using Spring Security‚Äôs JSP tag library
    • Accessing authentication details
    • Conditional rendering
    • Working with the Thymeleaf Spring Security dialect
    • Securing methods
    • Securing methods with annotations
    • Using expressions for method-level security
    • Filtering methods on input and output
    • Defining a permission evaluator
    • Exercise: Spring Security
  • Spring Web Flow
    • Conversational web applications
    • Adding Spring Web Flow dependencies
    • Configuring Spring Web Flow
    • Wiring a flow executor
    • Configuring a flow registry
    • Handling flow requests
    • Resolving views inside flow definitions
    • Importing the Spring Web Flow configuration
    • Adding Spring Web Flow to Spring Boot
    • Components of a flow
    • States
    • View states
    • Action states
    • Decision states
    • Subflow states
    • End states
    • Transitions
    • Global transitions
    • Flow data
    • Scoping flow data
    • Flow samples
    • Model validation
    • Partial validation
    • Supressing validation
    • Securing web flows
    • Signaling events
    • Advanced Web Flow features
    • Exercise: Spring Web Flow
  • SOAP Web Services
    • Web Services definition
    • XML Schema
    • Web Services architecture
    • Web Services styles
    • JAX-WS
    • Trade-offs
    • Spring Web Services
    • Spring Web Services features
    • Architecture of a Spring Web Services application
    • Writing contract-first Web Services
    • Problems with contract-last Web Services
    • Focus on the contract!
    • Defining the messages
    • The message contract
    • Creating the project
    • Adding libraries
    • Configuring Spring Web Services
    • Creating the Web Service endpoint
    • Defining the service
    • Defining Web Service operations
    • Publishing the Web Service
    • Creating Web Service clients with WebServiceTemplate
    • Exercise: Spring Web Services
  • Restful Web Services
    • Concepts of REST
    • Key principles
    • Identifiable resources
    • Uniform interface
    • Stateless communication
    • Resource representations
    • Hypermedia
    • Implementing REST
    • Advantages of RESTful HTTP
    • Comparing REST to Web Services
    • RESTful services in Spring
    • Rendering responses
    • Available HTTPMessageConverters
    • Adding HTTPMessageConverters
    • Creating a REST service
    • Running and testing
    • Adding JSON support
    • Creating a REST client
    • Exercise: RESTful Web Services
  • Spring Data REST
    • Spring Data REST
    • Configuring Spring Data REST
    • Spring Data REST settings
    • Creating a domain object
    • Creating a repository
    • Starting the REST application
    • Testing the application
    • The HAL browser
    • Projections and excerpts
    • Exercise: Spring Data REST
  • WebSockets
    • WebSockets support in Spring
    • Configuring WebSockets
    • Configuring Spring for STOMP
    • Implementing STOMP messages
    • Implementing the message-handling controller
    • Creating a WebSockets client
    • Exercise: WebSockets
  • Task scheduling
    • Task runners
    • TaskExecutor
    • Configuring task executors
    • TaskScheduler
    • Configuring task schedulers
    • Using task runners
    • Trigger
    • CronTrigger
    • Declarative scheduling
    • Asynchronous execution
    • Exercise: Task runners
  • Messaging in Spring
    • Asynchronous messaging
    • Advantages of asynchronous messaging
    • Spring JMS dependencies
    • Creating a message
    • Creating a message receiver
    • Configuring Spring JMS
    • Adding message converters
    • Configuring to publish-subscribe
    • Sending a response to another queue
    • Exercise: Messaging in Spring
  • Sending email
    • Sending email
    • Configuring Spring to send email
    • Configuring a mail sender
    • Configuring a mail session
    • Configuring a mail sender with Spring Boot
    • Wiring and using the mail sender
    • Testing the mail sender
    • Adding attachments
    • Sending email with rich content
    • Generating email with templates
    • Constructing email messages with Velocity
    • Constructing email messages with Thymeleaf
    • Exercise: Sending email