Spring Training

Duration: 3 Days

Course Overview

Spring Framework training course teaches attendees how to build Java applications using the Spring 3 framework.

Course Prerequisites

All Spring 3 training attendees must have at least one year of full-time Java and JSP development experience. Prior experience with servlets and JSP is recommended but not required.

Course Objectives

  • Understand the core principles of Spring, and of Dependency Injection (DI) Inversion of Control
  • Use the Spring Core module and DI to configure and wire application objects (beans) together
  • Understand and use the complete capabilities of the Core module, such as lifecycle events, bean scopes, and the Spring API
  • Work with the DAO and or ORM modules to create a well-structured persistence layer with JDBC
  • Use Springs Data Integration with JDBC and technologies such as Hibernate or JPA.
  • Understand and use Spring's powerful new AOP capabilities for programming cross-cutting concerns across multiple points in an application
  • Understand and use Spring's transaction support, including its easy to use tx aop XML configuration elements and Java 5 annotations
  • Integrate Spring with Java EE Web applications
  • Understand how Spring MVC works using the new @Controller model, and use it to build basic Web applications
  • Understand the basics of Spring Security, and how to secure Web apps and Spring managed beans with it

Course Outline

 

  • Overview of Spring Technology
    • Shortcomings of Java EE, Spring Architecture
  • Spring Introduction
    • Managing Beans, The Spring Container, IoC, DI
    • Configuration Metadata - XML, @Component, Auto-Detecting Beans
  • Dependencies and Dependency Injection (DI)
    • Dependency Inversion, Dependency Injection (DI) in Spring, DI Configuration - XML, @Resource
  • Working with Bean Properties
    • Configuring Value Properties, Property Conversions, Setter / Constructor Injection
  • Spring Expression Language for Configuration
  • Collection Valued Properties
    • Configuring and using lists, sets, etc.
  • Additional Capabilities
    • Factory Methods, Bean Aliases, Definition Inheritance (Parent Beans)
  • The Spring Container and API
    • ApplicationContext
      • ClassPathXmlApplicationContext, FileSystemXmlApplicationContext, Constructors, Usage
    • Resource Access - Overview, Resource Implementations
    • Validation
      • Overview, JSR-303
      • Declarative Validation, @NotNull, @Size, @Min, etc
      • Configuration, Injection
    • Bean Scope and Lifecycle
      • Bean Scope Defined, Configuring, Inner Beans, Bean Creation Lifecycle, Lifecycle Callbacks, BeanPostProcessor, Event Handling
    • MessageSources
      • Defining and Using Resource Bundles, Localization/I18N
    • Annotation Driven Configuration
      • Stereotypes: @Component, @Service, @Controller, @Repository
      • Java EE 5 Annotation Support
      • Defining Custom Annotations
      • Autowiring
    • Java Based Bean Metadata (JavaConfig)
      • Overview - code-centric Configuration
      • @Confguration, @Bean, and @Value
      • Importing and @Import
      • Autowiring in Configuration Classes
      • Mixing XML Configuraiton and @Configuration
      • XML vs Annotation Based Configuration
    • Other Capabilities
      • SpEL - Spring Expression Language
      • Validation
  • Database Access with Spring
    • Issues with JDBC / Typical JDBC Flow
    • Introduction to Spring DAO Support
      • Spring Database API, (Simple)JdbcTemplate, (Simple)JdbcDaoSupport, DataSources,
      • Working With and Configuring, <list>, <set>, With Bean Refs, <map>, <props>
    • Queries and Inserts
      • RowMapper, ParameterizedRowMapper, Passing Arguments, queryForObject, query, update
    • Additional API Capabilities
      • Additional query methods, Passing Type Arguments, queryForList, FetchSize, MaxRows
    • Using Spring with Hibernate
      • Overview of Template Approach, SessionFactory configuration
      • Using Contextual Sessions
    • Using Spring with JPA
      • LocalEntityManagerFactoryBean, LocalContainerEntityManagerFactoryBean, JNDI, PersistenceUnitManager
      • DAO Support - @PersistenceUnit, @PersistenceContext
  • Aspect Oriented Programming (AOP)
    • Overview of AOP
      • AOP Basics, Aspect, Joinpoint, Advice, Pointcut
    • Introduction to Spring AOP
      • Capabilities, Configuration (Annotation Based and XML), Weaving, Joinpoints
    • Using Aspects
      • Defining Advice, Configuring Pointcuts, Targets and Proxies
      • XML Configuration with <aop:>
      • AspectJ Pointcuts, Autoproxies
    • Using @AspectJ Annotations
  • Spring Transaction (TX) Management
    • Intro to Spring Transaction Management
      • Overview, Component TX Model, TX Propagation, Declarative Transactions, TransactionManagers
    • Using Spring Transactions
    • Annotation Configured Transactions
      • @Transactional and its settings
    • XML Configured Transactions
      • new <tx:*> elements, Configuring tx:advice, and tx:attributes
      • Defining the TX advisor
  • Introduction to Spring Web Integration and Spring MVC
    • Integrating Spring with Java EE Web Apps, ContextLoaderListener, WebApplicationContext
    • Spring Web MVC Overview, Capabilities, Architecture
    • Spring MVC Basics
      • DispatcherServlet, Configuration, mvc Namespace
      • Controllers, @Controller, Handler Methods
      • @RequestParam and Parameter Binding
      • View Resolvers
      • Writing Controllers, @Controller, @RequestMapping, @RequestParam, @PathVariable
      • Forms and Binding, Spring Form Tags, @ModelAttribute
      • Session Attributes, @SessionAttributes