This 5 day class enables the experienced Java developer to use the Spring Web Flow framework to create simple and complex web applications. Web Flow represents a powerful new approach to designing and developing web applications, and can also draw on the configuration capabilities of Spring itself. We begin with an introduction to the Spring Core module — which implements the configurable object container available to Web Flow applications as an application context — and get oriented to the Spring web framework, as underpinnings of the Web Flow system.
Then we dive into Web Flow itself, and develop key concepts of flow, state, transition, and action. We get moderately complex applications up and running with these elements, and see how the JavaBeans used to power a flow can also take advantage of Spring configuration and dependency injection. Then we move into more advanced techniques including custom converters, validators, and subflows. We conclude the course with a look at lifecycle and context features, such as the FlowExecutionListener.
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 simple Web Flow application, with declarative control over page flows.
- Bind model beans to pages, and control when binding should and shouldn’t occur.
- Invoke Java methods as actions on controllers, service objects, and other JavaBeans placed in Web Flow or Spring singleton scopes.
- Install custom data-binding logic.
- Develop validation logic for individual model beans and view states.
- Organize more complex applications into master flows and subflows.
- Observe the progress of a flow using a flow execution listener, and implement interceptors over one or more lifecycle hooks.
Outline
- Introduction to Spring
- Overview of Spring
- Java EE: The Good, The Bad, and the Ugly
- Enter the Framework
- Spring Value Proposition
- The Spring Container
- Web Applications
- Persistence Support
- Aspect-Oriented Programming
- The Java EE Module(s)
- Integrating Other Frameworks
- The Container
- JavaBeans, Reconsidered
- The Factory Pattern
- Inversion of Control
- XML View: Declaring Beans
- Java View: Using Beans
- Singletons and Prototypes
- Instantiation and Configuration
- Configuring Through Properties
- Configuration Namespaces
- The p: Notation
- Bean (Configuration) Inheritance
- Configuring Through Constructors
- Bean Post-Processors
- Lifecycle Hooks
- Integrating Existing Factory Code
- Dependency Injection
- Complex Systems
- Assembling Object Graphs
- Dependency Injection
- Single and Multiple Relationships
- The Utility Schema
- Bean Aliases
- Inner Beans
- Autowiring
- Auto-Detecting Beans
- @Autowired Properties
- Best Practices with Spring 2.5 Annotations
- Assembling Object Models
- Collections and Maps
- Support for Generics
- The Spring Utility Schema (util:)
- Autowiring to Multiple Beans
- Order of Instantiation
- Bean Factory vs. Application Context
- Validation
- Validators
- The Errors Object
- ValidationUtils
- Error Messages and Localization
- Nested Property Paths
- Overview of Spring
- The Spring Web Module
- The Web Module
- Servlets and JSPs: What’s Missing
- The MVC Pattern
- The Front Controller Pattern
- DispatcherServlet
- A Request/Response Cycle
- The Strategy Pattern
- JavaBeans as Web Components
- Web Application Contexts
- Handler Mappings
- “Creating” a Model
- View Resolvers
- Customizing Control Flow
- HandlerMapping Options
- ViewResolver Options
- Chaining View Resolvers
- Triggering Redirects
- The Web Module
- Spring Web Flow
- Introducing Spring Web Flow
- Spring Web Flow
- Relationship to Spring
- How It Works: Development Time
- How It Works: Request Time
- Totally Inverted Control
- The Web Flow Schema
- Flows, States, and Transitions
- Model Beans
- States and Transitions
- Flows
- View States
- Transitions
- Lifecycle Hooks
- Encoding Commands in HTML Views
- Global Transitions
- Web Flow URLs
- Actions
- Variables
- Scopes
- Actions
- Expression Language
- Implicit Objects
- Using Spring Beans
- Action and Decision States
- Sequence of Events
- Beans and Scopes
- Model Beans and Binding
- Web Flow Scopes
- Flow Scope
- View Scope
- POST-REDIRECT-GET
- Flash Scope
- Spring Singletons vs. Web Flow Scopes
- @Autowired Dependencies
- Binding
- Binding to a Model
- The MessageContext
- Message Bundles
- Reporting Error Messages
- Converters
- The ConversionService
- A Declarative Approach
- Validation
- Validation
- The ValidationContext
- Registering a Validator
- Adapting Spring Validators
- The MessageBuilder
- Subflows
- Designing with Web Flow
- Flow Input and Output
- Subflow States
- Conversation Scope
- Subflows as Factories
- Dynamic Transitions
- Action States as Join Points
- Lifecycle
- Observing Flow Execution
- The FlowExecutionListener
- The RequestContext
- The FlowSession
- Java View of Flow Definitions
- Implementing Interceptors
- Introducing Spring Web Flow
To Hire an AMS Java Spring Web Flow Subject Matter Expert and Instructor who also teaches this class, call us today at 800-798-3901!