JavaSpring MVC Web Applications Training

This 5 day class enables the experienced Java developer to use the Spring application framework to manage objects in a lightweight “IoC” (inversion-of-control) container; to create simple and complex web applications; and to manage persistent objects using Spring’s support for DAOs and transaction control. Spring is a far-reaching framework that aims to facilitate all sorts of Java development, including every level of multi-tier distributed systems. Here we focus on the Core and Web/MVC modules, with a slightly lighter touch on persistence through DAO and ORM modules.

The Core module gives the developer declarative control over object creation and assembly; this is useful for any tier of any Java application. So is Spring’s validation framework, and so we study these things in a mix of standalone (Java SE) applications and web applications.  Then students build web applications that use the Spring MVC framework to rationalize their designs into coherent request/response cycles. They use Spring command objects to manage HTML forms and their data, and connect these to the validation framework. We connect our applications to persistent stores and study the DAO and ORM modules, to better understand JDBC and JPA persistence models and declarative transaction control.

Goals

  • Understand the scope, purpose, and architecture of Spring
  • Use Spring’s bean factories and application contexts to declare application components, rather than hard-coding their states and lifecycles
  • Use dependency injection to further control object relationships from outside the Java code base
  • Use annotations to take advantage of Spring post-processors for automated bean instantiation and wiring
  • Create validators for business objects, and associate them for application-level and unit-testing uses
  • Build a web application as a Spring DispatcherServlet and associated application context
  • Use Spring MVC annotations to develop web controllers, mapping request URLs and other criteria to Java methods and binding request data to method parameters
  • Build and manage HTML forms with Spring command objects and custom tags
  • Use Spring interceptors to implement horizontal features in the web application
  • Connect business objects to persistent stores using Spring’s DAO and ORM modules
  • Simplify JDBC code using Spring templates
  • Integrate JPA entities and DAOs into Spring applications
  • Declare and enforce transaction requirements using Spring

Outline

  1. Overview of Spring
    1. Java EE: The Good, The Bad, and the Ugly
    2. Enter the Framework
    3. Spring Value Proposition
    4. The Spring Container
    5. Web Applications
    6. Persistence Support
    7. Aspect-Oriented Programming
    8. The Java EE Module(s)
    9. Integrating Other Frameworks
  2. The Container
    1. JavaBeans, Reconsidered
    2. The Factory Pattern
    3. Inversion of Control
    4. XML View: Declaring Beans
    5. Java View: Using Beans
    6. Singletons and Prototypes
  3. Instantiation and Configuration
    1. Configuring Through Properties
    2. Configuration Namespaces
    3. The p: Notation
    4. Bean (Configuration) Inheritance
    5. Configuring Through Constructors
    6. Bean Post-Processors
    7. Lifecycle Hooks
    8. Integrating Existing Factory Code
    9. Awareness Interfaces
  4. Dependency Injection
    1. Complex Systems
    2. Assembling Object Graphs
    3. Dependency Injection
    4. Single and Multiple Relationships
    5. The Utility Schema
    6. Bean Aliases
    7. Inner Beans
    8. Autowiring
    9. @Component, @Service, & Company
    10. @Autowired Properties
    11. Best Practices with Spring Annotations
  5. Assembling Object Models
    1. Collections and Maps
    2. Support for Generics
    3. The Spring Utility Schema (util:)
    4. Autowiring to Multiple Beans
    5. Order of Instantiation
    6. Bean Factory vs. Application Context
  6. Validation
    1. Validators
    2. The Errors Object
    3. ValidationUtils
    4. Error Messages and Localization
    5. Nested Property Paths
  7. The Web Module
    1. Servlets and JSPs: What’s Missing
    2. The MVC Pattern
    3. The Front Controller Pattern
    4. DispatcherServlet
    5. A Request/Response Cycle
    6. The Strategy Pattern
    7. Web Application Contexts
    8. Annotation-Based Handler Mappings
    9. @Controller and @RequestMapping
    10. “Creating” a Model
    11. Views and View Resolvers
  8. Handling Requests
    1. Matching URLs
    2. Identifying Views
    3. Request Parameters
    4. Injectable Parameters
    5. Command Objects
    6. Return Types
    7. HTTP Methods
    8. Path Variables
    9. Scope and Granularity of Command Objects
    10. Headers and Cookies
    11. RESTful Web Services
  9. Working with Forms
    1. Form Processing in Spring MVC
    2. Command Objects in Request Methods
    3. Spring Custom Tags
    4. <form:form> and Friends
    5. Command objects at Session Scope
    6. Limitations of @SessionAttributes
  10. Data Binding
    1. A Consolidated Process
    2. Property Editors
    3. Custom Property Editors
    4. DataBinder and @InitBinder Methods
    5. Converters and Formatters
    6. Using <mvc:annotation-driven/>
    7. Custom Formatters
  11. Binding and Validation
    1. Validating Form Input
    2. Spring Validators
    3. Deriving a Validator Reference
    4. Applying a Validator
    5. <form:error> and <form:errors>
    6. JSR 303, a/k/a Bean Validation
    7. Configurating JSR-303 Support
    8. The Spring JSR-303 Validator
    9. Automatic Support with @Valid
  12. Configuring Spring MVC
    1. Configuring Message Sources
    2. Resolving Error Codes
    3. HandlerExceptionResolver
    4. @ExceptionHandler
    5. Interceptors
    6. Filters in the Request-Handling Cycle
    7. Support and Utility Classes
    8. Spring Web Scopes
  13. Templates and DAOs
    1. The DAO Pattern
    2. The DaoSupport Hierarchy
    3. The DataAccessException Hierarchy
    4. JDBC DAOs
    5. JdbcTemplate and RowMapper<T>
  14. Working with JPA
    1. Object/Relational Mapping
    2. The Java Persistence API
    3. Hibernate
    4. @Entity and Other JPA Annotations
    5. Entity Managers and Factories
    6. The Persistence Unit
    7. JpaDaoSupport and JpaTemplate
    8. Configuration Issues
  15. Transactions
    1. Transaction Managers
    2. Transaction Advice
    3. AOP vs. Annotations
    4. JDBC Transaction Manager
    5. JPA Transaction Manager
    6. Entity States
    7. Extended Persistence Contexts

To Hire an AMS Enterprise JavaSwing Subject Matter Expert and Instructor who also teaches this class, call us today at 800-798-3901!

Leave a Reply