Spring 3.x and Spring MVC/REST
Private Training

Course Summary

This 5 day course is current with Spring 3.2, as well as earlier versions. It includes complete coverage of the annotation based approach to configuration, as well as coverage of the traditional XML-based configuration that can still play an important role in existing and new projects. Spring is a lightweight Java framework for building enterprise applications. Its Core module allows you to manage the lifecycle of your objects and the dependencies between them via configuration metadata (either XML or annotations) and Dependency Injection / Inversion of Control. Its advanced capabilities provide support for persistence frameworks like Hibernate (DAO and ORM modules), Aspect-Oriented Programming (AOP module), and integration with Java EE Web technologies, security, transactions, and more. This course is current with Spring 3.2, as well as earlier versions. The course includes integration of Spring with Java EE Web applications, and an introduction to Spring’s Web MVC. Spring MVC is a Web framework based on the powerful Model-View-Controller pattern, and the introduction covers the basics of Spring MVC, and how it supports organizing your Web applications in a highly structured, loosely coupled manner. The course now includes an introduction to REST (Representational state transfer) principles, and how to use Spring MVC to build RESTful services.

Audience
Java developers who need to work with Spring based applications.
Course Length
5 Days
Prerequisites
A good working knowledge of basic Java programming, interfaces, and JDBC.

Objectives

Understand the Spring framework and how to use it capabilities.

How to use Spring API and Spring configuration to write Spring programs.

Learn Data access via Spring’s data support.

Control transactions with Spring.

Use the Spring annotations and XML configuration elements.

Integrate Spring with Web applications and understand the basic structure and use Spring MVC.

Understand the architecture and basic use of Spring Security.

Use Spring’s AOP capabilities to inject crosscutting concerns.

Understand REST principals, and build REST services with Spring.

Detailed Outline

  1. Introduction to Spring
    • The Challenge of Enterprise Applications
    • Shortcomings of Java/Java EE
    • What is Spring?
    • The Spring Modules
    • The Spring Distribution
    • Spring Introduction
    • Managing Beans
    • A Basic Spring Application
    • Configuration Metadata
    • Declaring Beans
    • The Spring Container
    • Why Bother?
    • Dependencies and Dependency Injection
    • Dependencies between Objects
    • Dependency Inversion Principle
    • Advantages of Dependency Injection
    • Dependency Injection Reduces Coupling
  2. More about Bean Properties
    • Working with Properties
    • Using Value Based Properties
  3. The Spring Container and API
    • Application Context
    • Resource Access – Overview, Resource Implementations
    • Bean Scope and Lifecycle
    • Annotation Driven Configuration
    • Enabling Spring Annotations
    • Complete Declarations Using Annotations
    • XML Config for Annotations and Scanning
    • Qualifiers
    • Lifecycle Annotations
    • Java-based Configurations
    • Dependencies Between Configuration Classes
    • Classpath Scanning
    • Other @Bean Capabilities
    • Maven and Spring
    • How We will work with Maven
    • The POM
    • Repositories
    • Eclipse/Maven Integrations
  4. Database Acess with Spring
    • Overview of Spring database support
    • Configuring a DataSource
    • Using Spring with Hibernate
    • SessionFactory configuration
    • Using Contextual Sessions
    • Using Spring with JPA
    • LocalEntityManagerFactoryBean
    • JEE: Obtaining an EntityManager from JNDI
    • Extended Persistence Context
  5. Transactions
    • Intro to Spring Transaction Management
    • JTA Transaction Manager
    • Spring Transactional Scope
    • Using Spring Transactions
    • Transaction Attributes for Propagation
    • Rolling Back and Exceptions
    • Spring’s Load-Time Weaving
  6. Web Applications with Spring MVC
    • Integrating Spring with Java EE Web Apps, ContextLoaderListener, WebApplicationContext
    • Spring Web MVC Overview, Capabilities, Architecture
    • Spring MVC Basics
    • DispatcherServlet, Configuration, MVC
    • Controllers
    • Returning Model Data
    • The JSP Pages
    • Forms and Command Objects
    • A JavaBean Command Class
  7. Spring Security Overview
    • Overview – Capabilities, Architecture
    • Introduction to Spring Security
    • HTTP Security
    • Method Security
    • Annotation-Based Security
    • Expression-Based Access Control
    • Authentication Providers
  8. RESTful Services with Spring
    • REST Overview
    • Characteristics and Capabilities
    • URI Templates
    • REST vs SOAP
    • REST and Spring MVC
    • Spring support for REST
    • Writing RESTful Controllers
    • Returning XML and JSON data
    • Client-side Access to RESTful Services
    • Client Requirements and RestTemplate
    • Using RestTemplate
    • Accessing Header Info
    • Common REST Patterns
  9. Aspect Oriented Programming
    • (APO) (optional)
    • Overview of AOP
    • Introduction to Spring AOP
    • Pointcut Expressions and Advice
    • XML Based AOP Support
    • Defining Aspects Using XML
    • Spring Proxies and Direct Invocation
    • Is AOP Worth It?
    • Other AOP Capabilities and Functionality