Beginning Spring

Book description

Get up to speed quickly with this comprehensive guide to Spring

Beginning Spring is the complete beginner's guide to Java's most popular framework. Written with an eye toward real-world enterprises, the book covers all aspects of application development within the Spring Framework. Extensive samples within each chapter allow developers to get up to speed quickly by providing concrete references for experimentation, building a skillset that drives successful application development by exploiting the full capabilities of Java's latest advances.

Spring provides the exact toolset required to build an enterprise application, and has become the standard within the field. This book covers Spring 4.0, which contains support for Java 8 and Java EE 7. Readers begin with the basics of the framework, then go on to master the most commonly used tools and fundamental concepts inherent in any Spring project. The book emphasizes practicality and real-world application by addressing needs such as meeting customer demand and boosting productivity, and by providing actionable information that helps developers get the most out of the framework. Topics include:

  • Dependency Injection and Inversion of Control
  • Unit testing Spring enabled Web Applications 
  • Data Access using Spring JDBC and ORM support along with Transaction Management
  • Building Web Applications and RESTful Web Services with Spring MVC
  • Securing Web Applications using Spring Security
  • Spring Expression Language with its Extensive Features
  • Aspect Oriented Programming Facilities Provided by Spring AOP
  • Caching with 3rd Party Cache Providers’ Support
  • The Best of the Breed: Spring 4.0

The information is organized and structured an ideal way for students and corporate training programs, and explanations about inner workings of the framework make it a handy desk reference even for experienced developers. For novices, Beginning Spring is invaluable as a comprehensive guide to the real-world functionality of Spring.

Table of contents

  1. Foreword
    1. Foreword
  2. Introduction
    1. Who This Book Is For
    2. What This Book Covers
    3. What You Need to Run the Samples
    4. Conventions
    5. Errata
  3. Chapter 1: POJO Programming Model, Lightweight Containers, and Inversion of Control
    1. POJO Programming Model
    2. Lightweight Containers and Inversion of Control (IoC)
    3. Dependency Injection
    4. Summary
  4. Chapter 2: Dependency Injection with Spring
    1. Spring IoC Container
    2. Dependency Injection
    3. Spring-Managed Beans
    4. Summary
  5. Chapter 3: Building Web Applications Using Spring MVC
    1. Learning the Features and Benefits of Spring MVC
    2. Using the Dispatcher Servlet mechanism
    3. Creating Your First Spring MVC Application
    4. Configuring Spring MVC with Annotations
    5. Handling Forms with JSP
    6. Exploiting the Power of Annotations
    7. Validating User Input
    8. Uploading Files
    9. Handling Exceptions
    10. Implementing Internationalization (i18n)
    11. Using Themes
    12. Summary
  6. Chapter 4: JDBC Data Access with Spring
    1. Problems with Using Vanilla JDBC
    2. Introducing Spring's JDBC Support
    3. Performing Data Access Operations with Spring
    4. Modeling JDBC Operations as Java Objects
    5. Exception Handling and Error Code Translation
    6. Summary
  7. Chapter 5: Data Access with JPA Using Spring
    1. Brief Introduction to ORM and JPA
    2. Spring's JPA Support
    3. Summary
  8. Chapter 6: Managing Transactions with Spring
    1. Understanding Transaction Management
    2. Spring's Transaction Abstraction Model
    3. Declarative Transaction Management with Spring
    4. Programmatic Transaction Management with Spring
    5. Executing Custom Logic Before or After Transactions
    6. Summary
  9. Chapter 7: Test-Driven Development with Spring
    1. Configuring and Caching ApplicationContext
    2. Injecting Dependencies of Test Fixtures
    3. Using Transaction Management in Tests
    4. Testing Web Applications
    5. Using Mock Objects and Other Utilities for Testing
    6. Summary
  10. Chapter 8: Aspect-Oriented Programming with Spring
    1. Getting Started with AOP in Spring
    2. Becoming Familiar with Types of Advices
    3. Defining Point-Cut Designators
    4. Capitalizing on the Power of Annotations
    5. Blending AspectJ with Spring
    6. Configuring Spring AOP with Annotations
    7. Summary
  11. Chapter 9: Spring Expression Language
    1. Configuring Applications with SpEL
    2. Creating a Parser
    3. Invoking Methods
    4. Working with Variables and Functions
    5. Understanding SpEL Operators
    6. Using Utilities in SpEL
    7. Summary
  12. Chapter 10: Caching
    1. Building Your First Caching Application
    2. Working with Cache Annotations
    3. Implementing Cache Managers
    4. Casting Your SpEL on Caches
    5. Initializing Your Caches Programmatically
    6. Finding Alternative Cache Providers
    7. Summary
  13. Chapter 11: RESTful Web Services with Spring
    1. Creating Your First REST Web Service
    2. Returning Different HTTP Status Codes from REST Web Service
    3. Learning an Annotation-Based Configuration Alternative
    4. Using REST Web Services with XML
    5. Using the Exception Handling Mechanism
    6. Unit Testing RESTful Services
    7. Summary
  14. Chapter 12: Securing Web Applications with Spring Security
    1. Why Spring Security?
    2. Features of Spring Security
    3. Configuring and Using Spring Security
    4. Understanding the Fundamental Building Blocks of Spring Security
    5. Authenticating Users
    6. Authorizing Web Requests and Service Method Calls
    7. Summary
  15. Chapter 13: Next Stop: Spring 4.0
    1. Keeping Up with the Latest: Java 8 and Java EE7 Support
    2. Configuring Injection with Conditional Dependency
    3. Ordering the Elements of Autowired Collections
    4. Repeating Annotations
    5. Introducing New Annotations
    6. Summary
  16. Appendix: Solutions to Exercises
    1. Chapter 1
    2. Chapter 2
    3. Chapter 3
    4. Chapter 4
    5. Chapter 5
    6. Chapter 6
    7. Chapter 7
    8. Chapter 8
    9. Chapter 9
    10. Chapter 10
    11. Chapter 11
    12. Chapter 12
    13. Chapter 13
  17. Index
  18. End User License Agreement

Product information

  • Title: Beginning Spring
  • Author(s): Mert Caliskan, Kenan Sevindik, Rod Johnson, Jürgen Höller
  • Release date: February 2015
  • Publisher(s): Wrox
  • ISBN: 9781118892923