Spring Recipes: A Problem-Solution Approach

Front Cover
Apress, Sep 1, 2010 - Computers - 1104 pages

With over 3 million users/developers, Spring Framework is the leading “out of the box” Java framework. Spring addresses and offers simple solutions for most aspects of your Java/Java EE application development, and guides you to use industry best practices to design and implement your applications.

The release of Spring Framework 3 has ushered in many improvements and new features. Spring Recipes: A Problem-Solution Approach, Second Edition continues upon the bestselling success of the previous edition but focuses on the latest Spring 3 features for building enterprise Java applications. This book provides elementary to advanced code recipes to account for the following, found in the new Spring 3:

Spring fundamentals: Spring IoC container, Spring AOP/ AspectJ, and more Spring enterprise: Spring Java EE integration, Spring Integration, Spring Batch, jBPM with Spring, Spring Remoting, messaging, transactions, scaling using Terracotta and GridGrain, and more. Spring web: Spring MVC, Spring Web Flow 2, Spring Roo, other dynamic scripting, integration with popular Grails Framework (and Groovy), REST/web services, and more.

This book guides you step by step through topics using complete and real-world code examples. Instead of abstract descriptions on complex concepts, you will find live examples in this book. When you start a new project, you can consider copying the code and configuration files from this book, and then modifying them for your needs. This can save you a great deal of work over creating a project from scratch!

What you’ll learn How to use the IoC container and the Spring application context to best effect. Spring’s AOP support, both classic and new Spring AOP, integrating Spring with AspectJ, and load-time weaving. Simplifying data access with Spring (JDBC, Hibernate, and JPA) and managing transactions both programmatically and declaratively. Spring’s support for remoting technologies (RMI, Hessian, Burlap, and HTTP Invoker), EJB, JMS, JMX, email, batch, scheduling, and scripting languages. Integrating legacy systems with Spring, building highly concurrent, grid-ready applications using Gridgain and Terracotta Web Apps, and even creating cloud systems. Building modular services using OSGi with Spring DM and Spring Dynamic Modules and SpringSource dm Server. Delivering web applications with Spring Web Flow, Spring MVC, Spring Portals, Struts, JSF, DWR, the Grails framework, and more. Developing web services using Spring WS and REST; contract-last with XFire, and contract–first through Spring Web Services. Spring’s unit and integration testing support (on JUnit 3.8, JUnit 4, and TestNG). How to secure applications using Spring Security. Who this book is for

This book is for Java developers who would like to rapidly gain hands-on experience with Java/Java EE development using the Spring framework. If you are already a developer using Spring in your projects, you can also use this book as a reference—you’ll find the code examples very useful.

Table of Contents Introduction to Spring Advanced Spring IoC Container Spring AOP and AspectJ Support Scripting in Spring Spring Security Integrating Spring with Other Web Frameworks Spring Web Flow Spring @MVC Spring RESTSpring and Flex Grails Spring Roo Spring Testing Spring Portlet MVC Framework Data Access Transaction Management in Spring EJB, Spring Remoting, and Web Services Spring in the Enterprise Messaging Spring Integration Spring Batch Spring on the Grid jBPM and Spring OSGi and Spring

About the author (2010)

Gary Mak, founder and chief consultant of Meta-Archit Software Technology Limited, has been a technical architect and application developer on the enterprise Java platform for more than seven years. He is the author of the Apress books Spring Recipes: A Problem-Solution Approach and Pro SpringSource dm Server. In his career, Gary has developed a number of Java-based software projects, most of which are application frameworks, system infrastructures, and software tools. He enjoys designing and implementing the complex parts of software projects. Gary has a master's degree in computer science. His research interests include object-oriented technology, aspect-oriented technology, design patterns, software reuse, and domain-driven development. Gary specializes in building enterprise applications on technologies including Spring, Hibernate, JPA, JSF, Portlet, AJAX, and OSGi. He has been using the Spring Framework in his projects since Spring version 1.0. Gary has been an instructor of courses on enterprise Java, Spring, Hibernate, Web Services, and agile development. He has written a series of Spring and Hibernate tutorials as course materials, parts of which are open to the public, and they're gaining popularity in the Java community. In his spare time, he enjoys playing tennis and watching tennis competitions.

Daniel Rubio is an independent consultant with over 10 years of experience in enterprise and web-based software. More recently, Daniel is founder and technical lead at MashupSoft.com.

Josh Long is the Spring developer advocate for SpringSource, an editor for InfoQ.com, and author/co-author of many works (including Spring Recipes: A Problem-Solution Approach, Second Edition, published by Apress). Josh has spoken at numerous industry conferences, including Geecon, TheServerSide Java Symposium, SpringOne, OSCON, JavaZone, Devoxx, JAX, and Java2Days. When he’s not hacking on Spring Integration and other open-source code (see http://Git.SpringSource.org, http://GitHub.com/SpringSource, and http://GitHub.com/JoshLong), he can be found at the local Java user group, a coffee shop, or the airport. Josh likes solutions that push the boundaries of the technologies that enable them. His interests include scalability, big data, business process management, grid processing, rich Internet applications, mobile computing, and so-called "smart systems". He blogs at http://blog.springsource.org and JoshLong.com, and can be reached at josh@joshlong.com.

Bibliographic information