EIEIOTECHNOVATION
← Training programmes

EIEIO / PROGRAMMING & DEVELOPMENT

Spring Boot

Course outline

4 days

Duration

4 days

Overview

A framework provides a standard way to build and deploy applications. Framework provides generic functionality, which can be selectively changed by additional user-written code, thus providing application-specific software. Frameworks aim to facilitate software development by allowing programmers to devote their time to meeting software requirements rather than dealing with more standard low-level details of providing a working system, thereby reducing overall development time. For instance, a team developing a banking website can focus on writing code particular to banking rather than the mechanics of request handling, user role management and state management.

Web applications can be developed using existing JEE technologies such as servlets, JDBC, JSP. When application grows without a framework the hard-wired page navigations, control logic, business logic will start causing headaches and the code gets messy. Spring is an open source powerful Java application framework, used in a wide range of Java applications. Spring provides enterprise services to Plain Old Java Objects (POJOs) and uses dependency injection to achieve simplification and increase testability. The extensions available in Spring framework assist in building web applications on top of Java EE platform. Spring framework targets to make J2EE development easier to use and promotes good programming practices by enabling a POJO-based programming model.

Spring framework is bloated with tons facilities and helpers. It is framework that glues things together such as Struts, JSF, ORM frameworks and other facilities like Quartz, Email and most likely Spring supports almost everything. The drawback is it takes quite a lengthy process to set it up and running. Spring boot is built on totally a different thought. It is basically a suite, pre-configured, pre-sugared set of frameworks / technologies to reduce boiler plate configuration providing the shortest way to have a Spring web application up and running with smallest line of code / configuration out-of-the-box. It takes less than 20 lines to have a simple RESTful application up and running with almost zero configurations. In short, Spring Boot is the framework and tools designed to simplify the bootstrapping and development of a new Spring application and empower Java teams to build robust, hassle free applications.

This course provides an introduction to Spring Boot. It discusses the features of Spring Boot and how to utilize Spring Boot to rapidly define, configure, and add features to applications using Spring Boot. Participants will learn how to leverage Spring Boot to ease development and leverage the Spring framework to take the drudgery out of Spring development.

Objective

  • Understand the basics of Web Application - POST, GET, HTTP, MVC Pattern
  • Create Spring MVC Applications using various options
  • Run the applications using the embedded servlet containers
  • Styling the web project using Bootstrap framework
  • Connect to databases using Spring Data
  • Build REST Services in Spring Boot
  • Secure your applications using Spring Security
  • Create an executable JAR of your application
  • Understand Spring Boot Actuator and Spring Boot Developer Tools

Target Participants

The primary target audience for this course is software developers / programmers.

  • Students new to Spring Boot
  • Students new & existing to the Spring Framework
  • You should NOT take this course if you have never used Java before.

Program Prerequisites

  • Students should be familiar with the Java programming language
  • Web Development Experience (HTML / CSS / JavaScript)
  • A computer that can run Spring Tools Suite
  • Familiar with MVC

Mode of Delivery

Every participant will be provided with course notes and are required to bring in their own laptops for hands-on exercise and practice sessions.

Course Outcome

By end of this program every participant will complete “creating a web based customer profile solution”. The solution will allow the administrator to login and create customers. Every customer record will have multiple tabs consisting of address details, order details, payment details and shipping details.

The customer will be able to login to the portal and view their details, modify their address details, order details and also update their payment details.

Course Content

  • Introduction to Spring Boot
  • Introduction to Spring
  • "HelloWorld" Spring MVC application using Maven
  • Spring Framework Configuration
  • Java @Configuration Classes
  • Defining @Configuration Classes
  • Loading @Configuration Classes
  • Modularizing @Configuration Classes
  • Qualifying @Bean Methods
  • Trouble with Prototype Scope
  • Configuration with Spring Expression Language
  • Resolving Text Messages
  • Spring Property Conversion
  • Spring Converter Interface
  • Using Custom Converters
  • Spring PropertyEditors
  • Registering Custom PropertyEditors
  • Introduction to Spring Boot
  • What is Spring Boot?
  • Spring Boot Main Features
  • Understanding Java Annotations
  • Spring MVC Annotations
  • Example of Spring MVC-based RESTful Web Service
  • Spring Booting Your RESTful Web Service
  • Spring Boot Skeletal Application Example
  • Converting a Spring Boot Application to a WAR File
  • Externalized Configuration
  • Starters
  • The 'pom.xml' File
  • Spring Boot Maven Plugin
  • Create a Spring Boot Application
  • Spring MVC
  • Spring Web Modules
  • Spring MVC Components
  • DispatcherServlet
  • Template Engines
  • Spring Boot MVC Example
  • Spring MVC Mapping of Requests
  • Advanced @RequestMapping
  • Composed Request Mappings
  • Spring MVC Annotation Controllers
  • Controller Handler Method Parameters
  • Controller Handler Method Return Types
  • View Resolution
  • Spring Boot Considerations
  • Overview of Spring Boot Database Integration
  • DAO Support in Spring
  • Spring Data Access Modules
  • Spring JDBC Module
  • Spring ORM Module
  • DataAccessException
  • @Repository Annotation
  • Using DataSources
  • DAO Templates
  • DAO Templates and Callbacks
  • ORM Tool Support in Spring
  • Using Spring with JPA or Hibernate
  • Spring JPA
  • Benefits of Using Spring with ORM
  • Spring @Repository
  • Using JPA with Spring
  • Configure Spring Boot JPA EntityManagerFactory
  • Application JPA Code
  • "Classic" Spring ORM Usage
  • Spring JpaTemplate
  • Spring JpaCallback
  • JpaTemplate Convenience Features
  • Spring Boot Considerations
  • Spring Data JPA Repositories
  • WebSockets

Introduction

  • HTTP vs WebSocket
  • When to use it
  • WebSocket API
  • WebSocket Handler
  • WebSocket Handshake
  • Deployment
  • Server config
  • Allowed origins
  • SocketJS Fallback
  • Enable SockJS
  • Client disconnects
  • SockJS and CORS
  • SockJSClient
  • Enable STOMP
  • Flow of Messages
  • Handler methods
  • Send Messages
  • Simple and External Broker
  • Connect to Broker
  • Authentication
  • Performance
  • Monitoring
  • Testing
  • Spring REST Services
  • Many Flavors of Services
  • Understanding REST
  • RESTful Services
  • REST Resource Examples
  • REST vs SOAP
  • REST Services With Spring MVC
  • Spring MVC @RequestMapping with REST
  • Working With the Request Body and Response Body
  • @RestController Annotation
  • Implementing JAX-RS Services and Spring
  • JAX-RS Annotations
  • Java Clients Using RestTemplate
  • RestTemplate Methods
  • Spring Micro services
  • Evaluation of Micro Services
  • Principles Of Micro Services
  • Characteristics of Micro Services
  • Micro services Benefits
  • Relationship with SOA
  • Twelve Factor Apps
  • Micro Services use cases
  • Micro Services early adopters
  • Building micro services with boot
  • Micro Services Capability model
  • Micro Services Use case
  • Stateless Microservice with Basic Auth and CORS
  • Stateful Microservice with Form Auth, CSRF and CORS
  • Stateful Microservice with SPA Integrated
  • Spring Security
  • Securing Web Applications with Spring Security 3.0
  • Spring Security 3.0
  • Authentication and Authorization
  • Programmatic v Declarative Security
  • Getting Spring Security from Maven
  • Spring Security Configuration
  • Spring Security Configuration Example
  • Authentication Manager
  • Using Database User Authentication
  • LDAP Authentication
  • Security Basics
  • Storing Passwords
  • Hashing Passwords (MD5 and SHA256)
  • Spring Security & JPA
  • Auto-configuration/simple security
  • JDBC security
  • OAuth2 Login Java Config
  • OAuth2 Client support
  • OAuth2 Security in a microservice architecture
  • Spring JMS
  • JmsTemplate
  • Connection and Destination
  • JmsTemplate Configuration
  • Transaction Management
  • Example Transaction Configuration
  • Producer Example
  • Consumer Example
  • Converting Messages
  • Message Listener Containers
  • Message-Driven POJO's Async Receiver Example
  • Message-Driven POJO's Async Receiver Configuration
  • Spring Boot Considerations
  • Spring Boot Actuator
  • What is Spring Boot Actuator?
  • Spring Boot Actuator Endpoints
  • Installing Spring Boot Actutator
  • Default Endpoints
  • Custom Endpoints
  • Securing Endpoints
  • Customizing Endpoint Paths
  • Spring Boot Actuator Health Endpoint
  • Available Auto Configured Health Indicators
  • Custom Health Indicators
  • Auto Configured Information Contributors
  • Custom Application Information
  • Adding Git Commit Information
  • Spring Boot Actuator Metrics

Introduction

  • System Metrics Overview
  • System Metrics Demo
  • Custom Metrics
  • DEPLOYMENT
  • Continuous Development and Delivery
  • JAR/WAR

Programme scope, delivery arrangements and suitability are confirmed during enquiry.