Expert Spring MVC and Web Flow

(Dana P.) #1

■CONTENTS xiii



  • ■CHAPTER 1 Introduction Acknowledgments xviii

    • Skipping Ahead

    • How to View This Book

    • Roadmap

    • Target Audience

    • For More Information

      • Sample Applications



    • Spring 2.0

    • Summary



  • ■CHAPTER 2 Spring Fundamentals

    • Inversion of Control

      • IoC Example

      • Summary



    • Dependency Injection

      • Service Locator

      • Dependency Injection



    • Spring ApplicationContexts

    • The Return of the POJO

    • Impact on Web Applications

    • Summary



  • ■CHAPTER 3 Spring MVC Application Architecture.

    • Layers of Abstractions

      • Layer Isolation

      • Java Interface As Layer Contract

      • Layers in a Spring MVC Application



    • Options: There’s More Than One Way to Do It



  • ■CHAPTER 4 Jump into Spring MVC

    • Use Cases

      • Service Interface

      • Use Case #1

      • Use Case #2

      • Summary



    • Web Components

      • JAR Dependencies

      • Controllers

      • Views

      • ModelAndView



    • Building the Home Page Use Case

      • Spring MVC Components

      • Web Application Configuration

      • Start the Application

      • Request Handling Sequence

      • Summary



    • Building the Search for Flights Use Case

      • SimpleFormController

      • SearchFlightsController

      • Form View

      • Spring JSP Tags

      • Success View

      • Summary



    • Now Let’s Learn How to Swim



  • ■CHAPTER 5 The Processing Pipeline

    • Processing Requests

      • Request Work Flow

      • Functionality Overview

      • Pieces of the Puzzle



    • Summary



  • ■CHAPTER 6 The Controller Menagerie

    • Introduction

    • The Controller Interface and Implementations

      • A Look at Design

      • AbstractController

      • Summary

      • BaseCommandController

      • Binding a Form to a Bean

      • Summary

      • SimpleFormController and Handling Forms

      • Redirect After Submit Pattern

      • MultiActionController

      • AbstractWizardFormController

      • ThrowawayController

      • ValidatableThrowawayController



    • HandlerInterceptors

      • HandlerInterceptor Example

      • Summary



    • Controllers Summary



  • ■CHAPTER 7 The View Layer

    • What’s in a View

      • Treating Views in Isolation



    • Spring’s View Interface

      • Implementing View

      • Views and Controllers: Happily Divorced



    • ViewResolvers

      • Putting View Resolution in Context

      • Types of ViewResolver

      • Making ViewResolvers Known to the Dispatcher



    • A Word on Redirecting

    • Themes

      • ThemeSources

      • ThemeResolvers



    • Internationalization in the View Layer

      • Locale Resolution

      • MessageSource Beans

      • View Resolution

      • Theme Resolution



    • Bind Support

      • Recap of Binding and Validation Sequence

      • Bind Support in View Templates



    • Summary



  • ■CHAPTER 8 Supported View Types

    • JSP and JSTL

      • Exposing the Model As Request Attributes

      • Displaying the Model

      • JSP Tag Libraries

      • Forms



    • Tiles

      • Summary



    • Velocity and FreeMarker

      • Templating Pros and Cons

      • Basic Configuring for Template Engines

      • Exposing the Model

      • The Template Language

      • Advanced Configuration Options

      • Forms and the SpringBind Macros

      • Number and Date Tools

      • Additional Velocity Views

      • Summary



    • XML and XSLT

      • Defining an XSLT View

      • Transforming the XML Source

      • Returning XML in the Raw

      • Other Noteworthy XSLT Features

      • Summary



    • PDF

      • Configuring the Application to Use a PDF View

      • Template PDFs with FOP



    • Excel

      • Creating the Template

      • Coding the View

      • Configuring the Application



    • JasperReports

      • Multiformat View

      • Populating the Report

      • Summary



    • Creating New Views

    • Summary



  • ■CHAPTER 9 Validation

    • Programmatic Validators

    • Declarative Validators

    • Message Sources

    • Validators and Business Logic

    • Errors Interface

    • Testing Validators

    • Summary



  • ■CHAPTER 10 Testing Spring MVC Applications

    • Overview

      • Unit Tests

      • Unit Test Summary

      • Integration Tests



    • Testing Summary



  • ■CHAPTER 11 Introduction to Spring Web Flow

    • What Itch Does Spring Web Flow Scratch?

      • The Problem with the Servlet Specification

      • The Solution



    • Not a Golden Hammer

    • The Big Picture

      • Architectural Overview

      • Inside the Spring Web Flow System

      • Different Scopes

      • Building Blocks



    • Your First Flow

      • Installing Spring Web Flow

      • Proposed Flow Directory Structure

      • The Purchase Product Flow Definition

      • Implementing the First Step: View States

      • Transitions

      • Actions

      • Action Bean Definitions

      • Testing the Flow Execution

      • Extending AbstractFlowExecutionTests

      • Decision States

      • Action States

      • End States

      • The Purchase Product Flow: What’s Next

      • Spring MVC Deployment

      • The FlowController

      • FlowRegistry

      • Additional Configuration

      • View Template Resolution

      • View Template Requirements

      • Launching the Flow from the Browser



    • Summary

      • Model Conversations

      • Allows for Extension

      • Testable

      • Identifying Flows (Easy, Natural Language)





  • ■CHAPTER 12 Advanced Spring Web Flow

    • Business Logic and Flows

      • Business Logic



    • Flow Granularity

      • Subflows

      • Inline Flows

      • Summary



    • Managing FlowExecutions

      • Integration with Web Frameworks

      • The FlowExecutionManager

      • FlowExecutions

      • FlowExecutionListener



    • FlowExecution Repositories

      • Continuations

      • FlowExecutionRepository Implementations

      • Stateful FlowExecution Repositories

      • Stateless FlowExecution Repositories

      • Conversation Invalidation After Completion



    • States and Transitions Revisited

      • Action States

      • POJO Actions

      • Exposing POJO Method Return Values

      • Customizing View Selection with View States and End States

      • Decision States



    • Exception Handling

      • State Scoped ExceptionHandlers



    • Exception Handling Summary

    • Summary



  • ■APPENDIX A Documenting Your MVC Application

    • BeanDoc

      • Installing and Building BeanDoc

      • Running BeanDoc on Your Configuration Files

      • Other Options

      • Controlling the Output



    • Summary



  • ■APPENDIX B Ajax and DWR

    • Spring and DWR

    • A Practical Example

      • Configuration and Code Changes

      • Presentation File Changes



    • Accessibility

    • Summary



  • ■INDEX.

Free download pdf