Table of Contents

Copyright

Brief Table of Contents

Table of Contents

Praise for Spring in Action

Preface

Acknowledgments

About this Book

About the Cover Illustration

1. Core Spring

Chapter 1. Springing into action

1.1. Simplifying Java development

1.1.1. Unleashing the power of POJOs

1.1.2. Injecting dependencies

1.1.3. Applying aspects

1.1.4. Eliminating boilerplate code with templates

1.2. Containing your beans

1.2.1. Working with an application context

1.2.2. A bean’s life

1.3. Surveying the Spring landscape

1.3.1. Spring modules

1.3.2. The Spring portfolio

1.4. What’s new in Spring

1.4.1. What’s new in Spring 2.5?

1.4.2. What’s new in Spring 3.0?

1.4.3. What’s new in the Spring portfolio?

1.5. Summary

Chapter 2. Wiring beans

2.1. Declaring beans

2.1.1. Setting up Spring configuration

2.1.2. Declaring a simple bean

2.1.3. Injecting through constructors

2.1.4. Bean scoping

2.1.5. Initializing and destroying beans

2.2. Injecting into bean properties

2.2.1. Injecting simple values

2.2.2. Referencing other beans

2.2.3. Wiring properties with Spring’s p namespace

2.2.4. Wiring collections

2.2.5. Wiring nothing (null)

2.3. Wiring with expressions

2.3.1. Expressing SpEL fundamentals

2.3.2. Performing operations on SpEL values

2.3.3. Sifting through collections in SpEL

2.4. Summary

Chapter 3. Minimizing XML configuration in Spring

3.1. Automatically wiring bean properties

3.1.1. The four kinds of autowiring

3.1.2. Default autowiring

3.1.3. Mixing auto with explicit wiring

3.2. Wiring with annotations

3.2.1. Using @Autowired

3.2.2. Applying standards-based autowiring with @Inject

3.2.3. Using expressions with annotation injection

3.3. Automatically discovering beans

3.3.1. Annotating beans for autodiscovery

3.3.2. Filtering component-scans

3.4. Using Spring’s Java-based configuration

3.4.1. Setting up for Java-based configuration

3.4.2. Defining a configuration class

3.4.3. Declaring a simple bean

3.4.4. Injecting with Spring’s Java-based configuration

3.5. Summary

Chapter 4. Aspect-oriented Spring

4.1. What’s aspect-oriented programming?

4.1.1. Defining AOP terminology

4.1.2. Spring’s AOP support

4.2. Selecting join points with pointcuts

4.2.1. Writing pointcuts

4.2.2. Using Spring’s bean() designator

4.3. Declaring aspects in XML

4.3.1. Declaring before and after advice

4.3.2. Declaring around advice

4.3.3. Passing parameters to advice

4.3.4. Introducing new functionality with aspects

4.4. Annotating aspects

4.4.1. Annotating around advice

4.4.2. Passing arguments to annotated advice

4.4.3. Annotating introductions

4.5. Injecting AspectJ aspects

4.6. Summary

2. Spring application essentials

Chapter 5. Hitting the database

5.1. Learning Spring’s data access philosophy

5.1.1. Getting to know Spring’s data access exception hierarchy

5.1.2. Templating data access

5.1.3. Using DAO support classes

5.2. Configuring a data source

5.2.1. Using JNDI data sources

5.2.2. Using a pooled data source

5.2.3. JDBC driver-based data source

5.3. Using JDBC with Spring

5.3.1. Tackling runaway JDBC code

5.3.2. Working with JDBC templates

5.4. Integrating Hibernate with Spring

5.4.1. A Hibernate overview

5.4.2. Declaring a Hibernate session factory

5.4.3. Building Spring-free Hibernate

5.5. Spring and the Java Persistence API

5.5.1. Configuring an entity manager factory

5.5.2. Writing a JPA-based DAO

5.6. Summary

Chapter 6. Managing transactions

6.1. Understanding transactions

6.1.1. Explaining transactions in only four words

6.1.2. Understanding Spring’s transaction management support

6.2. Choosing a transaction manager

6.2.1. JDBC transactions

6.2.2. Hibernate transactions

6.2.3. Java Persistence API transactions

6.2.4. Java transaction API transactions

6.3. Programming transactions in Spring

6.4. Declaring transactions

6.4.1. Defining transaction attributes

6.4.2. Declaring transactions in XML

6.4.3. Defining annotation-driven transactions

6.5. Summary

Chapter 7. Building web applications with Spring MVC

7.1. Getting started with Spring MVC

7.1.1. Following a request through Spring MVC

7.1.2. Setting up Spring MVC

7.2. Writing a basic controller

7.2.1. Configuring an annotation-driven Spring MVC

7.2.2. Defining the home page controller

7.2.3. Resolving views

7.2.4. Defining the home page view

7.2.5. Rounding out the Spring application context

7.3. Handling controller input

7.3.1. Writing a controller that processes input

7.3.2. Rendering the view

7.4. Processing forms

7.4.1. Displaying the registration form

7.4.2. Processing form input

7.4.3. Validating input

7.5. Handling file uploads

7.5.1. Adding a file upload field to the form

7.5.2. Receiving uploaded files

7.5.3. Configuring Spring for file uploads

7.6. Summary

Chapter 8. Working with Spring Web Flow

8.1. Installing Spring Web Flow

8.1.1. Configuring Web Flow in Spring

8.2. The components of a flow

8.2.1. States

8.2.2. Transitions

8.2.3. Flow data

8.3. Putting it all together: the pizza flow

8.3.1. Defining the base flow

8.3.2. Collecting customer information

8.3.3. Building an order

8.3.4. Taking payment

8.4. Securing web flows

8.5. Summary

Chapter 9. Securing Spring

9.1. Introducing Spring Security

9.1.1. Getting started with Spring Security

9.1.2. Using the Spring Security configuration namespace

9.2. Securing web requests

9.2.1. Proxying servlet filters

9.2.2. Configuring minimal web security

9.2.3. Intercepting requests

9.3. Securing view-level elements

9.3.1. Accessing authentication details

9.3.2. Rendering with authorities

9.4. Authenticating users

9.4.1. Configuring an in-memory user repository

9.4.2. Authenticating against a database

9.4.3. Authenticating against LDAP

9.4.4. Enabling remember-me functionality

9.5. Securing methods

9.5.1. Securing methods with @Secured

9.5.2. Using JSR-250’s @RolesAllowed

9.5.3. Pre-/Post-invocation security with SpEL

9.5.4. Declaring method-level security pointcuts

9.6. Summary

3. Integrating Spring

Chapter 10. Working with remote services

10.1. An overview of Spring remoting

10.2. Working with RMI

10.2.1. Exporting an RMI service

10.2.2. Wiring an RMI service

10.3. Exposing remote services with Hessian and Burlap

10.3.1. Exposing bean functionality with Hessian/Burlap

10.3.2. Accessing Hessian/Burlap services

10.4. Using Spring’s HttpInvoker

10.4.1. Exposing beans as HTTP services

10.4.2. Accessing services via HTTP

10.5. Publishing and consuming web services

10.5.1. Creating Spring-enabled JAX-WS endpoints

10.5.2. Proxying JAX-WS services on the client side

10.6. Summary

Chapter 11. Giving Spring some REST

11.1. Getting REST

11.1.1. The fundamentals of REST

11.1.2. How Spring supports REST

11.2. Writing resource-oriented controllers

11.2.1. Dissecting a RESTless controller

11.2.2. Handling RESTful URLs

11.2.3. Performing the REST verbs

11.3. Representing resources

11.3.1. Negotiating resource representation

11.3.2. Working with HTTP message converters

11.4. Writing REST clients

11.4.1. Exploring RestTemplate’s operations

11.4.2. GETting resources

11.4.3. PUTting resources

11.4.4. DELETE-ing resources

11.4.5. POSTing resource data

11.4.6. Exchanging resources

11.5. Submitting RESTful forms

11.5.1. Rendering hidden method fields in JSP

11.5.2. Unmasking the real request

11.6. Summary

Chapter 12. Messaging in Spring

12.1. A brief introduction to JMS

12.1.1. Architecting JMS

12.1.2. Assessing the benefits of JMS

12.2. Setting up a message broker in Spring

12.2.1. Creating a connection factory

12.2.2. Declaring an ActiveMQ message destination

12.3. Using Spring’s JMS template

12.3.1. Tackling runaway JMS code

12.3.2. Working with JMS templates

12.4. Creating message-driven POJOs

12.4.1. Creating a message listener

12.4.2. Configuring message listeners

12.5. Using message-based RPC

12.5.1. Working with Spring message-based RPC

12.5.2. Asynchronous RPC with Lingo

12.6. Summary

Chapter 13. Managing Spring beans with JMX

13.1. Exporting Spring beans as MBeans

13.1.1. Exposing methods by name

13.1.2. Using interfaces to define MBean operations and attributes

13.1.3. Working with annotation-driven MBeans

13.1.4. Handing MBean collisions

13.2. Remoting MBeans

13.2.1. Exposing remote MBeans

13.2.2. Accessing remote MBeans

13.2.3. Proxying MBeans

13.3. Handling notifications

13.3.1. Listening for notifications

13.4. Summary

Chapter 14. Odds and ends

14.1. Externalizing configuration

14.1.1. Replacing property placeholders

14.1.2. Overriding properties

14.1.3. Encrypting external properties

14.2. Wiring JNDI objects

14.2.1. Working with conventional JNDI

14.2.2. Injecting JNDI objects

14.2.3. Wiring EJBs in Spring

14.3. Sending email

14.3.1. Configuring a mail sender

14.3.2. Constructing the email

14.4. Scheduling and background tasks

14.4.1. Declaring scheduled methods

14.4.2. Declaring asynchronous methods

14.5. Summary

14.6. The end...?

Index

List of Figures

List of Tables

List of Listings

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset