Introduction to Spring 4, Spring MVC, and Spring REST

Customized Onsite Training

5
Days
  • Customized Content
  • For Groups of 5+
  • Online or On-location
  • Expert Instructors

Live Online Training

$2,375.00
or 5 vouchers
  • Live Online Training
  • Expert Instructors
  • Guaranteed to Run
  • 100% Free Re-take Option
  • 1-minute Video

Upcoming Classes

  • See More Classes

Please select a class.
Overview

This Introduction to Spring 4, Spring MVC, and Spring REST training class introduces techniques for using these powerful capabilities. It includes complete coverage of the three main configuration styles: Java-based (@Configuration), annotation-based (@Component), and the traditional XML-based configuration that may still play an important role in existing and new projects. It also provides guidelines for when and how to use each one.

The course starts with in-depth coverage on using the powerful capabilities of Spring's Core module to reduce coupling and increase the flexibility, ease of maintenance, and testing of your applications. It goes on to cover many of the most important capabilities of Spring, including integrating persistence layers (e.g. Hibernate/JPA) with Spring, using Spring's powerful Aspect Oriented Programming (AOP) to program cross-cutting concerns in a safe and maintainable way, and using Spring's declarative transaction capabilities.

The course includes integration of Spring with Java EE Web applications, and an introduction to Spring MVC. Spring MVC utilizes a Model-View-Controller pattern for building Web applications, and the intoduction covers the basics of Spring MVC, and how it supports organizing your Web applications in a highly structured, loosely coupled manner. This includes an introduction to REST (Representational state transfer), and how to use Spring MVC to build RESTful resources and invoke them from Ajax-based front ends.

This course is hands on with labs to reinforce all the important concepts.It will enable you to build working Spring applications and give you an understanding of the important concepts and technology in a very short time.

The standard platform does all labs with the Eclipse IDE, and the lab instructions include detailed directions for setting up and using it. The course can be made available for all major development environments, including IBM RAD and IntelliJ.

Goals
  1. Understand the core principles of Spring, and of Dependency Injection (DI) / Inversion of Control.
  2. Use the Spring Core module and DI to configure and wire application objects (beans) together.
  3. Know the different types of metadata (XML, annotations/@Component, and Java Configuration/@Configuration), and how and when to use them.
  4. Understand and use the complete capabilities of the Core module, such as lifecycle events, bean scopes, and the Spring API.
  5. Work with the ORM (Object-Relational Mapping) module to integrate Spring with technologies such as Hibernate or JPA.
  6. Understand and use Spring's powerful AOP capabilities for programming cross-cutting concerns across multiple points in an application.
  7. Learn safe and maintainable techniques for programming with AOP.
  8. Understand and use Spring's transaction support, including the easy-to-use Java annotation support, as well as the tx/aop XML configuration elements.
  9. Integrate Spring with Java EE Web applications.
  10. Build Web applications with Spring MVC, including configuration using Java config and Servlet 3 capabilities.
  11. Understand REST, and use Spring MVC to build RESTful services.
  12. Use Ajax-based front ends with Spring MVC / Spring REST.
Outline
  1. Introduction to Spring
    1. Overview of Spring Technology
      1. Challenges for Modern Applications
      2. Motivation for Spring, Spring Architecture
      3. The Spring Framework
    2. Spring Introduction
      1. Managing Beans
      2. Inversion of Control / IoC, Dependency Injection / DI
      3. Configuration Metadata Overview, Configuring Beans (XML)
    3. The Spring Container
      1. Overview of the Spring Container
      2. A Simple Spring Example
      3. ApplicationContext Overview
      4. ClassPathXmlApplicationContext, FileSystemXmlApplicationContext, AnnotationConfigApplicationContext
      5. API and Usage
    4. Dependencies and Dependency Injection (DI)
      1. Examining Dependencies
      2. Dependency Inversion
      3. Dependency Injection (DI) in Spring - Basic Configuration and Usage
  2. Configuration in Depth
    1. Annotation Driven Configuration
      1. JSR 330 (@Named) and Spring (@Component) annotation styles
      2. @Named/@Component, @Inject/@Autowired, @Repository, @Service
      3. Configuring Beans and Autowiring with Annotations
      4. Enabling Annotations - context:component-scan
      5. Pros and Cons
    2. Java Based Configuration (@Configuration)
      1. Overview - code-centric Configuration
      2. @Configuration and @Bean
      3. Dependency Injection
      4. Resolving Dependencies on Other Beans, Injecting Configuration Classes
      5. Pros and Cons
    3. Integrating Configuration Types
      1. Choosing a Configuration Style
      2. Integrating Configuration Styles
      3. Importing: @Import and
      4. Scanning with @Configuration style
    4. Bean Scope and Lifecycle
      1. Bean Scope Defined - singleton, prototype, and Other Scopes
      2. Configuring Scope
      3. Bean Creation Lifecycle, Lifecycle Callbacks
      4. BeanPostProcessor, Event Handling
  3. Wiring in Depth
    1. Value Injection
      1. Configuring Value Properties, Property Conversions
      2. Externalizing Values in Properties Files
    2. Constructor Injection
      1. Constructor Injection Overview
      2. Configuration - @Configuration and XML
      3. p: and c: namespaces for XML configuration
    3. Qualifiers / Domain Specific Language (DSL)
      1. Limitations of Autowiring
      2. Qualifiers and DSL
      3. Creating and Using an Annotation-Based DSL for Bean Configuration
      4. Benefits of Qualifiers for Bean Configuration
    4. Profiles
      1. Profiles Overview
      2. Configuring Profiles (XML and @Configuration)
      3. Activating Profiles
    5. Overview of SpEL
  4. Database Access with Spring
    1. Overview of Spring database support
    2. Configuring a DataSource
    3. Using Spring with Hibernate
    4. High Level Hibernate Overview
      1. SessionFactory configuration, LocalSessionFactoryBean
      2. Contextual Sessions and Spring Integration
      3. Using Spring with JPA
    5. Managing the EntityManager (EM)
      1. LocalContainerEntityManagerFactoryBean and Container-managed EMs
      2. JEE and JNDI Lookup of the EM
      3. Configuration and Vendor Adaptors
      4. Creating a JPA Repository/DAO Bean - @PersistenceUnit, @PersistenceContext
  5. Aspect Oriented Programming (AOP)
    1. Overview of AOP
      1. Crosscutting Concerns
      2. AOP Basics, Aspect, Joinpoint, Advice, Pointcut
    2. Spring AOP Introduction
      1. Configuration - XML and @AspectJ
      2. Defining an Aspect, Pointcut, and Advice
      3. How Advice is Triggered
    3. Pointcut Expressions and Advice
      1. Pointcut Expression Overview
      2. The execution() Designator
      3. Other Designators (within, target, args, @target, ...)
      4. Kinds of Advice - before, after, around, after-returning, after-throwing
    4. Marker Annotations (Rubber Stamp AOP)
      1. Issue with AOP Configuration
      2. Defining an AOP Marker / Rubber Stamp
      3. Configuring AOP Using a Marker
      4. Advantages of Marker Annotations
    5. @AspectJ Based AOP Support
      1. @AspectJ Annotations Overview
      2. Defining an Aspect, Pointcut, and Advice
    6. Other Considerations
      1. Spring AOP Proxies and Self-Invocation Issues
      2. Load-Time Weaving
      3. Caveats of AOP
  6. Spring Transaction (TX) Management
    1. Intro to Spring Transaction Management
      1. Spring Transaction Managers
      2. Spring Declarative TX Management
      3. Spring TX Scope and Propagation
      4. Spring TX Attributes (REQUIRED, SUPPORTS, etc)
    2. XML Configuration of Transactions
      1. Specifying Advice, TX Attributes, and Methods
      2. Linking Advice with Pointcuts
      3. Benefits of XML Configuration of TX Behavior
  7. Spring Web Integration and Intro to Spring MVC
    1. Integrating Spring with Java EE Web Apps - ContextLoaderListener and WebApplicationContext
    2. Spring Web MVC Overview, Capabilities, Architecture (Front Controller, MVC Pattern)
    3. Spring MVC Basics
      1. DispatcherServlet, Configuration (@EnableWebMvc, Servlet 3 initialization), mvc Namespace
      2. Controllers, @Controller, @RequestMapping (Handler Methods)
      3. @RequestParam and Parameter Binding
      4. View Resolvers
      5. Controller Details, @RequestMapping, @RequestParam, @PathVariable
      6. Model Data, @ModelAttribute, Model/ModelAndView Classes
  8. Additional Spring MVC Capabilities
    1. Reference Data with @ModelAttribute
    2. Forms and Binding, Spring Form Tags
    3. Session Attributes, @SessionAttributes
    4. Validation / JSR-303
  9. RESTful Services with Spring
    1. REST Overview (Characteristics/Capabilities, URI Templates, REST vs SOAP
    2. REST and Spring MVC
      1. Spring support for REST
      2. @RequestMapping/@PathVariable, @RequestBody, @ResponseBody, HTTP Method conversion
      3. URI Templates and @PathVariable
      4. Writing RESTful Controllers / @RestController
    3. Generating JSON
      1. JSON Overview
      2. JSON Representations for Resources
      3. Message Converters
    4. Generating XML
      1. JAXB and Jackson Message Converters for XML
      2. JAXB / @XmlRootElement
    5. Content Negotiation
  10. Java Clients for RESTful Services
    1. Client Requirements and Spring's RestTemplate
    2. getForObject() / getForEntity()
    3. Other RestTemplate Methods
    4. Accessing Headers / exchange()
  11. Common REST Patterns
    1. GET: Read
    2. POST: Create
    3. PUT: Update
    4. DELETE: Delete
    5. Programming on server side, and client side (with RestTemplate)
  12. XML Specific Configuration
    1. Collection Valued Properties - Configuring and using lists, sets, etc.
    2. Additional Capabilities
      1. Factory Classes and Factory Methods
      2. Definition Inheritance (Parent Beans)
      3. AutoWiring with XML
      4. Inner Beans, Compound Names
Class Materials

Each student in our Live Online and our Onsite classes receives a comprehensive set of materials, including course notes and all the class examples.

Class Prerequisites

Experience in the following is required for this Spring class:

  • Java programming is required
  • Basic knowledge of XML is recommended
  • Web development with servlets and JSP is recommended
  • For the final chapter some undersatnding of JUnit is required

Experience in the following would be useful for this Spring class:

  • Basic knowledge of XML.
  • Web development with servlets and JSP.
Preparing for Class

No cancelation for low enrollment

Certified Microsoft Partner

Registered Education Provider (R.E.P.)

GSA schedule pricing

74,706

Students who have taken Live Online Training

15,222

Organizations who trust Webucator for their training needs

100%

Satisfaction guarantee and retake option

9.41

Students rated our trainers 9.41 out of 10 based on 5,179 reviews

Contact Us or call 1-877-932-8228