Home Page Icon
Home Page
Table of Contents for
About the Technical Reviewer
Close
About the Technical Reviewer
by Aleksa Vukotic, Jan Machacek, Anirvan Chakraborty, Jessica Ditt
Pro Spring 2.5
Copyright
Foreword
About the Authors
About the Technical Reviewer
Acknowledgments
Introduction
I. Getting Started with Spring
1. Introducing Spring
What Is Spring?
Beyond Dependency Injection
Aspect-Oriented Programming with Spring
Accessing Data in Spring
Simplifying and Integrating with Java EE
Job Scheduling Support
Mail Support
Dynamic Languages
Remoting Support
Managing Transactions
The Spring MVC Framework
Spring Web Flow
AJAX
Internationalization
Simplified Exception Handling
The Spring Project
Origins of Spring
The Spring Community
Spring for Microsoft .NET
The Spring IDE
The Spring Security (Formerly Acegi)
Alternatives to Spring
The Sample Code
Summary
2. Getting Started
Obtaining the Spring Framework
Checking Out Spring from CVS
Building Spring from Source Code
Verifying Your Spring Distribution
Spring Packaging
Spring Dependencies
Spring Sample Applications
Setting Up Spring and Your IDE
Hello, World
Putting Spring Into "Hello, World"
Dependency Injection
The Impact of Spring
Summary
3. Introducing Inversion of Control
IoC and DI
Types of IoC
Contextualized Dependency Lookup
Constructor DI
Setter DI
Injection vs. Lookup
Setter Injection vs. Constructor Injection
IoC in Spring
DI with Spring
Beans and BeanFactories
BeanFactory Implementations
XML Bean Definition
Using Constructor Injection
Injection Parameters
Understanding Bean Naming
Bean Instantiation Modes
Resolving Dependencies
Automatically Wiring Your Beans
Checking Dependencies
Bean Inheritance
Summary
4. Beyond the Basics
Spring's Impact on Application Portability
Bean Life Cycle Management
Hooking into Bean Creation
Hooking into Bean Destruction
Making Your Beans Spring Aware
Using the BeanNameAware Interface
Using the BeanFactoryAware Interface
Using Method Injection
Lookup Method Injection
Method Replacement
Using FactoryBean
The MessageDigestFactoryBean
Accessing a FactoryBean Directly
The BeanFactoryPostProcessor
Implementing a BeanFactoryPostProcessor
JavaBeans PropertyEditor
The Built-in PropertyEditors
Creating a Custom PropertyEditor
The BeanPostProcessor
Implementing a BeanPostProcessor
When to Use BeanPostProcessor
The Spring ApplicationContext
Implementations of ApplicationContext
Using ApplicationContextAware
Controlling Bean Initialization
Using Annotation-Based Configuration
Internationalization with MessageSource
Using MessageSource in Stand-Alone Applications
The MessageSourceResolvable Interface
Using Application Events
Considerations for Event Usage
Accessing Resources
Summary
5. Introducing Spring AOP
AOP Concepts
Types of AOP
Static AOP
Dynamic AOP
Choosing an AOP Type
AOP in Spring
The AOP Alliance
"Hello, World" in AOP
Spring AOP Architecture
The ProxyFactory Class
Creating Advice in Spring
Advisors and Pointcuts in Spring
The Pointcut Interface
Using ComposablePointcut
Pointcutting Summary
All About Proxies
Understanding Proxies
Using JDK Dynamic Proxies
Using CGLIB Proxies
Comparing Proxy Performance
Which Proxy to Use?
Summary
6. Advanced AOP
@AspectJ
@AspectJ Aspects in Detail
Pointcuts
Pointcut Expressions
Exploring the Pointcut Expressions
Using the @Pointcuts in XML
Types of Advice
Argument Binding
Introductions
The Aspect Life Cycle
Framework Services for AOP
Creating Our First Aspect Using the aop Namespace
Pointcuts in the aop Namespace
Creating Advice Using the aop Namespace
Introductions in the aop Namespace
Which Style Should You Use?
Working with Spring AOP Proxies
Impact of Proxies
AspectJ Integration
Creating Your First AspectJ Aspect
Compiling the Sample Application
AspectJ's Aspect Scope
Load-Time Weaving
Your First Load-Time Weaving Example
LoadTimeWeaver Lookup Strategies
Practical Uses of AOP
Performance and Health Monitoring
Summary
7. Spring Schemas and Namespaces
Why the New Configuration?
Schemas Included in Spring 2.5
The beans Schema
The context Schema
The util Schema
The tx Schema
The aop Schema
The jee Schema
The lang Schema
Behind the Schema Scenes
Custom Schemas
IDE Configuration
Summary
8. Spring Patterns
Directory Structure
Simple Applications
Complex Applications
Packaging and Naming
Design Patterns Introduction
Programming Against Interfaces
Creational Patterns
Structural Patterns
Behavioral Patterns
Template Method
Spring Application Patterns
Layered Design
High-Performance Paging
Multiple Error Reporting
User Interface Transactions
Background Processes
E-mail Notifications
Error Collecting and Logging
Summary
II. Data Access
9. JDBC Support
Key JDBC Concepts
Using the DriverManager and Connections
Using PreparedStatements
Using CallableStatements
Other JDBC Concepts
Concepts in Spring Data Access Support
JDBC Data Access Support
Using the JdbcTemplate
JdbcTemplate.execute
JdbcTemplate.query and Friends
JdbcTemplate.update
JdbcTemplate.batchUpdate
RdbmsOperation Subclasses
SqlUpdate
BatchSqlUpdate
SqlCall and StoredProcedure
SqlQuery and Its Subclasses
JdbcTemplate or RdbmsOperation?
Large Binary Objects
JdbcDaoSupport
Simple Spring JDBC
SimpleJdbcTemplate
SimpleJdbcCall
SimpleJdbcInsert
SimpleJdbcDaoSupport
Summary
10. iBATIS Integration
What Is iBATIS?
iBATIS Versions
Infrastructure and Configuration
Mapping Files
sqlMap Files
Configuring iBATIS and Spring
Selecting Data
Simple Selects
One-to-One Selects
One-to-Many Selects
Many-to-Many Selects
Updating Data
Deleting Data
Inserting Data
What's Missing from iBATIS?
Overall Performance
Summary
11. Hibernate Support
Hibernate Primer
Packaging
Introduction to Hibernate Support
Using Hibernate Sessions
Using HibernateDaoSupport
Deciding Between HibernateTemplate and Session
Using Hibernate in Enterprise Applications
Preventing Stale Data Updates
Object Equality
Transactional Behavior
Lazy Loading
Dealing with Large Data Sets
Handling Large Objects
Combining Hibernate with Other DAO Code
Summary
III. Enterprise Application Components
12. Job Scheduling with Spring
Scheduling Jobs Using JDK Timer
Trigger Types with Timer
Creating a Simple Job
Spring Support for JDK Timer Scheduling
Scheduling Jobs Using OpenSymphony Quartz
Introducing Quartz
Quartz Support in Spring
Job Scheduling Considerations
Choosing a Scheduler
Packaging Job Logic Separately from the Job Class
Task Execution and Thread Pooling
Summary
13. Mail Support in Spring
The Spring Mail API Structure
Configuring Mail Settings Using Spring
Sending Simple E-mails
Constructing and Sending E-mail Programmatically
Constructing E-mail Declaratively
Constructing and Sending MIME Messages
Insight into Enterprise-Level E-mail Handling
Summary
14. Dynamic Languages
Supported Languages Primer
BeanShell
Groovy
JRuby
Using Dynamic Languages As Spring Beans
Behind the Scenes of Dynamic Language Support
Proxying Dynamic Language Beans
Performance
Refreshable Beans
BeanShell Beans
JRuby Beans
Groovy Beans
Typical Usage for Dynamic Languages in Spring Applications
Summary
IV. Java EE 5
15. Using Spring Remoting
Spring Remoting Architecture
Remote Method Invocation
Exposing Arbitrary Services
Accessing an RMI Service Using Proxies
Exposing CORBA Services
Accessing a CORBA Service
Web Services with JAX-RPC
Introducing Apache Axis
Creating a Web Service with ServletEndpointSupport
Accessing RPC-Style Web Services using Proxies
Working with JavaBeans in Axis Services
Using JAX-WS Web Services
Exposing Web Services Using SimpleJaxWsServiceExporter
Exposing a Web Service Using XFire
Accessing JAX-WS Web Services
Accessing Java Web Services from Other Clients
Creating Web Services with HTTP Invoker
Exposing Simple Services
Accessing an HTTP Invoker Service Using Proxies
Using Arbitrary Objects in HTTP Invoker Services
Using HTTP Basic Authentication
Choosing a Remoting Architecture
Summary
16. Transaction Management
Exploring the Spring Transaction Abstraction Layer
Analyzing Transaction Properties
Exploring the TransactionDefinition Interface
Using the TransactionStatus Interface
Implementations of the PlatformTransactionManager
Exploring a Transaction Management Sample
Nontransactional Code
Programmatic Transaction Management
Using the TransactionTemplate Class
Programmatic Transaction Management Summary
Declarative Transaction Management
Using the TransactionProxyFactoryBean
Implications of Using Proxies in Transaction Management
AOP Transaction Management
Using Annotation-Based AOP Transaction Management
Using XML AOP Transaction Management
Working with Transactions Over Multiple Transactional Resources
Implementing Your Own Transaction Synchronization
Summary
17. Web Applications with Spring MVC
MVC Architecture
Spring MVC
MVC Implementation
Using Handler Mappings
Spring Controllers
AbstractController
ParameterizableViewController
MultiActionController
Interceptors
Views, Locales, and Themes
Using Views Programmatically
Using View Resolvers
Using Localized Messages
Using Locales
Using Themes
Command Controllers
Using Form Controllers
Exploring the AbstractWizardFormController
File Upload
Handling Exceptions
Spring and Other Web Technologies
Using JSP
Using Velocity
FreeMarker
Using XSLT Views
Using PDF Views
Using Excel Views
Using Tiles
JasperReports
Spring Conventions Over Configuration
Controller Conventions
MultiActionController Conventions
Model Conventions
View Conventions
Using Annotations for Controller Configuration
@Controller
@RequestMapping
@RequestParam
@ModelAttribute
Using Annotations with the Command Controller
Summary
18. Spring Web Flow
Introducing Spring Web Flow
Core Concepts
Obtaining Spring Web Flow
Spring Web Flow Dependencies
Hello, Web Flow!
Exploring States
View State
Decision State
End State
Working with Transitions
Advanced Concepts
Expression Languages and Scopes
Implementing Actions
Model Data Binding
Partial Rendering of Views
Mapping Flow Input and Output Parameters
Using Subflows
Spring Web Flow Behind the Scenes
Flow Execution Architecture
Flow Executor
Flow Definition Registry
Flow Execution Repository
Integration with Spring MVC
Flow Handling
View Resolving
Securing Flows with Spring Security
Step 1: Adding the SecurityFlowExecutionListener
Step 2: Basic Authentication and Authorization Handling
Step 3: Defining Security Rules in Flow Definitions
Problem Solver
Stateful Navigational Control
Browser Navigation Bar Support and Double Submit
Testing Flow Definitions
Summary
19. Spring and AJAX
DWR
Installing DWR
Spring Configuration for DWR
About the Complete Example
Testing the DWR Configuration
Running the Complete Example
DWR Scripting Basics
Using Simple Callback Functions
Calling Metadata Objects
engine.js
Call Batching
Call Ordering
Handling Errors and Warnings
util.js
Security in DWR
Advantages and Disadvantages of DWR
Summary
20. JMX with Spring
JMX Refresher
Exposing Your Beans
MBeanExporter
MBeanServerFactoryBean
Exposing Your Beans in an Existing MBean Server
Bean Registration Behavior
Controlling Object Names
Controlling the Management Interface
MBeanInfoAssembler Interface
MethodNameBasedMBeanInfoAssembler Interface
Using Java Interfaces to Control the Management Interface
Using Source-Level Metadata
Remoting with Spring JMX
Exposing Remote MBeans
Accessing Remote MBeans
Proxying MBeans
Notifications in Spring JMX
Notification Listeners
Publishing Notifications
Summary
21. Testing with Spring
Unit Testing
Unit Tests
Unit Testing the Web Layer
Integration Tests
Using AbstractSpringContextTests
Using AbstractDependencyInjectionSpringContextTests
Using AbstractTransactionalSpringContextTests
Using AbstractAnnotationAwareTransactionalTests
JNDI
Spring TestContext Framework
Application Context and DI with the TestContext Framework
Transactions in the TestContext Framework
Support Classes
Test Coverage
Summary
22. Spring Performance Tuning
Performance vs. Responsiveness
Exploring Enterprise Application Performance Issues
Measuring Java EE Application Performance
Finding Out What to Measure
Determining the Necessary Data Sets
Improving the Data Access Tier
Improving Transaction Management
Controlling the Performance of Remote Calls
Understanding View Performance
Using Caching
Performance Testing
Monitoring Application Health and Performance
More Resources on Performance Tuning
Summary
Search in book...
Toggle Font Controls
Playlists
Add To
Create new playlist
Name your new playlist
Playlist description (optional)
Cancel
Create playlist
Sign In
Email address
Password
Forgot Password?
Create account
Login
or
Continue with Facebook
Continue with Google
Sign Up
Full Name
Email address
Confirm Email Address
Password
Login
Create account
or
Continue with Facebook
Continue with Google
Prev
Previous Chapter
About the Authors
Next
Next Chapter
Acknowledgments
About the Technical Reviewer
Add Highlight
No Comment
..................Content has been hidden....................
You can't read the all page of ebook, please click
here
login for view all page.
Day Mode
Cloud Mode
Night Mode
Reset