Spring-Framework-Ref

Total Page:16

File Type:pdf, Size:1020Kb

Spring-Framework-Ref Reference Documentation 3.1 Copyright © 2004-2011 Rod Johnson, Juergen Hoeller, Keith Donald, Colin Sampaleanu, Rob Harrop, Alef Arendsen, Thomas Risberg, Darren Davison, Dmitriy Kopylenko, Mark Pollack, Thierry Templier, Erwin Vervaet, Portia Tung, Ben Hale, Adrian Colyer, John Lewis, Costin Leau, Mark Fisher, Sam Brannen, Ramnivas Laddad, Arjen Poutsma, Chris Beams, Tareq Abedrabbo, Andy Clement, Dave Syer, Oliver Gierke, Rossen Stoyanchev Copies of this document may be made for your own use and for distribution to others, provided that you do not charge any fee for such copies and further provided that each copy contains this Copyright Notice, whether distributed in print or electronically. Spring Framework Table of Contents I. Overview of Spring Framework ..............................................................................................1 1. Introduction to Spring Framework ..................................................................................2 1.1. Dependency Injection and Inversion of Control ....................................................2 1.2. Modules ............................................................................................................3 Core Container .................................................................................................3 Data Access/Integration ....................................................................................4 Web .................................................................................................................4 AOP and Instrumentation ..................................................................................5 Test .................................................................................................................5 1.3. Usage scenarios .................................................................................................5 Dependency Management and Naming Conventions ...........................................9 Spring Dependencies and Depending on Spring ........................................11 Maven Dependency Management ............................................................12 Ivy Dependency Management .................................................................13 Logging .........................................................................................................14 Not Using Commons Logging .................................................................14 Using SLF4J ..........................................................................................15 Using Log4J ...........................................................................................16 II. What's New in Spring 3 ......................................................................................................18 2. New Features and Enhancements in Spring 3.0 .............................................................19 2.1. Java 5 ..............................................................................................................19 2.2. Improved documentation ..................................................................................19 2.3. New articles and tutorials ..................................................................................19 2.4. New module organization and build system .......................................................20 2.5. Overview of new features .................................................................................21 Core APIs updated for Java 5 ..........................................................................22 Spring Expression Language ...........................................................................22 The Inversion of Control (IoC) container ..........................................................23 Java based bean metadata ........................................................................23 Defining bean metadata within components ..............................................24 General purpose type conversion system and field formatting system .................24 The Data Tier .................................................................................................24 The Web Tier .................................................................................................25 Comprehensive REST support .................................................................25 @MVC additions ...................................................................................25 Declarative model validation ...........................................................................25 Early support for Java EE 6 .............................................................................25 Support for embedded databases ......................................................................25 3. New Features and Enhancements in Spring 3.1 .............................................................26 3.1. Overview of new features .................................................................................26 3.1 Reference Documentation ii Spring Framework Cache Abstraction ..........................................................................................26 Bean Definition Profiles ..................................................................................26 Environment Abstraction ................................................................................26 PropertySource Abstraction .............................................................................26 Code equivalents for Spring's XML namespaces ...............................................27 Support for Hibernate 4.x ................................................................................27 TestContext framework support for @Configuration classes and bean definition profiles ..........................................................................................................27 c: namespace for more concise constructor injection .........................................28 Support for injection against non-standard JavaBeans setters .............................28 Support for Servlet 3 code-based configuration of Servlet Container ..................28 Support for Servlet 3 MultipartResolver ...........................................................28 JPA EntityManagerFactory bootstrapping without persistence.xml ....................28 New HandlerMethod-based Support Classes For Annotated Controller Processing .......................................................................................................................29 "consumes" and "produces" conditions in @RequestMapping ...........................30 Flash Attributes and RedirectAttributes ............................................................30 URI Template Variable Enhancements .............................................................30 @Valid On @RequestBody Controller Method Arguments ...............................30 @RequestPart Annotation On Controller Method Arguments ............................30 UriComponentsBuilder and UriComponents .....................................................31 III. Core Technologies ............................................................................................................32 4. The IoC container .......................................................................................................33 4.1. Introduction to the Spring IoC container and beans .............................................33 4.2. Container overview ..........................................................................................33 Configuration metadata ...................................................................................34 Instantiating a container ..................................................................................36 Composing XML-based configuration metadata .......................................37 Using the container .........................................................................................38 4.3. Bean overview .................................................................................................38 Naming beans .................................................................................................40 Aliasing a bean outside the bean definition ...............................................40 Instantiating beans ..........................................................................................41 Instantiation with a constructor ................................................................42 Instantiation with a static factory method .................................................42 Instantiation using an instance factory method ..........................................43 4.4. Dependencies ...................................................................................................44 Dependency injection ......................................................................................44 Constructor-based dependency injection ...................................................44 Setter-based dependency injection ...........................................................47 Dependency resolution process ................................................................48 Examples of dependency injection ...........................................................49 Dependencies and configuration in detail .........................................................51 Straight values (primitives, Strings, and so on) .........................................51 References
Recommended publications
  • Adapting the Java Modeling Language for Java 5 Annotations Kristina B
    Computer Science Technical Reports Computer Science 4-2008 Adapting the Java Modeling Language for Java 5 Annotations Kristina B. Taylor Iowa State University Johannes Rieken Iowa State University Gary T. Leavens Iowa State University Follow this and additional works at: http://lib.dr.iastate.edu/cs_techreports Part of the Software Engineering Commons Recommended Citation Taylor, Kristina B.; Rieken, Johannes; and Leavens, Gary T., "Adapting the Java Modeling Language for Java 5 Annotations" (2008). Computer Science Technical Reports. 310. http://lib.dr.iastate.edu/cs_techreports/310 This Article is brought to you for free and open access by the Computer Science at Iowa State University Digital Repository. It has been accepted for inclusion in Computer Science Technical Reports by an authorized administrator of Iowa State University Digital Repository. For more information, please contact [email protected]. Adapting the Java Modeling Language for Java 5 Annotations Abstract The aJ va Modeling Language (JML) is a formal specification language for Java that allows to express intended behavior through assertions. Currently, users must embed these assertions in Java comments, which complicates parsing and hinders tool support, leading to poor usability. This paper describes a set of proposed Java 5 annotations which reflect current JML assertions and provides for better tool support. We consider three alternative designs for such annotations and explain why the chosen design is preferred. This syntax is designed to support both a design-by-contract subset of JML, and to be extensible to the full language. We demonstrate that by building two tools: Modern Jass, which provides almost-native support for design by contract, and a prototype that works with a much larger set of JML.
    [Show full text]
  • Apache Camel
    Apache Camel USER GUIDE Version 2.8.5 Copyright 2007-2011, Apache Software Foundation 1 Table of Contents Table of Contents ....................................................ii Chapter 1 Introduction........................................................... 1 Chapter 1 Quickstart.............................................................. 1 Chapter 1 Getting Started ...................................................... 7 Chapter 1 Architecture..........................................................18 Chapter 1 Enterprise Integration Patterns .............................36 Chapter 1 Cook Book.............................................................41 Chapter 1 Tutorials ............................................................. 122 Chapter 1 Language Appendix............................................. 227 Chapter 1 DataFormat Appendix.......................................... 301 Chapter 1 Pattern Appendix ................................................ 379 Chapter 1 Component Appendix .......................................... 538 Index ..................................................................... 0 ii APACHE CAMEL CHAPTER 1 °°°° Introduction Apache Camel â„¢ is a versatile open-source integration framework based on known Enterprise Integration Patterns. Camel empowers you to define outingr and mediation rules in a variety of domain-specific languages, including a Java-based Fluent API, Spring or Blueprint XML Configuration files, and a Scala DSL. This means you get smart completion of routing rules in your IDE,
    [Show full text]
  • Spring IO Platform Reference Guide
    Spring IO Platform Reference Guide Brussels-SR5 Copyright © 2014-2017 Copies of this document may be made for your own use and for distribution to others, provided that you do not charge any fee for such copies and further provided that each copy contains this Copyright Notice, whether distributed in print or electronically. Spring IO Platform Reference Guide Table of Contents I. Spring IO Platform Documentation ............................................................................................ 1 1. About the documentation ................................................................................................ 2 2. Getting help .................................................................................................................... 3 II. Getting Started ....................................................................................................................... 4 3. Introducing Spring IO Platform ........................................................................................ 5 4. Using Spring IO Platform ................................................................................................ 6 4.1. Using Spring IO Platform with Maven .................................................................... 6 4.2. Using Spring IO Platform with Gradle .................................................................... 7 5. Overriding Spring IO Platform’s dependency management ................................................ 9 5.1. Overriding a version using Maven ........................................................................
    [Show full text]
  • Third Party Licenses and Information
    Third Party Licenses and Information This page contains information regarding any third party code included with your SAS software, including applicable third party software notices and/or additional terms and conditions. SAS Visual Data Mining and Machine Learning 8.3 Component Applicable License(s) @openui5/sap.f 1.52.10 Apache License 2.0 @openui5/sap.m 1.52.10 Apache License 2.0 @openui5/sap.m 1.56.0 Apache License 2.0 @openui5/sap.tnt 1.52.10 Apache License 2.0 @openui5/sap.ui.commons 1.52.5 Apache License 2.0 @openui5/sap.ui.core 1.52.5 Apache License 2.0 @openui5/sap.ui.demokit 1.52.10 Apache License 2.0 @openui5/sap.ui.documentation 1.52.10 Apache License 2.0 @openui5/sap.ui.fl 1.52.11 Apache License 2.0 @openui5/sap.ui.layout 1.52.10 Apache License 2.0 @openui5/sap.ui.suite 1.52.10 Apache License 2.0 @openui5/sap.ui.support 1.52.10 Apache License 2.0 @openui5/sap.ui.table 1.52.10 Apache License 2.0 @openui5/sap.ui.ux3 1.52.10 Apache License 2.0 @openui5/sap.uxap 1.52.5 Apache License 2.0 @paulwib/event-source-polyfill 0.0.13 MIT License @rokt33r/ace-builds 1.1.9 BSD 3-clause "New" or "Revised" License @spalger/filesaver 1.0.0 MIT License abego TreeLayout Core 1.0.1 BSD 3-clause "New" or "Revised" License ACE - Ajax.org Cloud9 Editor 1.2.3 BSD 3-clause "New" or "Revised" License ace-builds 1.1.9 BSD 3-clause "New" or "Revised" License ace-builds 1.2.0 BSD 3-clause "New" or "Revised" License ace-builds v1.2.6 BSD 3-clause "New" or "Revised" License acota-utils 0.3.7 Apache License 2.0 adobe-source-sans-pro-fonts 1.050 SIL Open Font
    [Show full text]
  • Struts 2 in Action
    Struts 2 in Action Struts 2 in Action DONALD BROWN CHAD MICHAEL DAVIS SCOTT STANLICK MANNING Greenwich (74° w. long.) For online information and ordering of this and other Manning books, please visit www.manning.com. The publisher offers discounts on this book when ordered in quantity. For more information, please contact: Special Sales Department Manning Publications Co. Sound View Court 3B fax: (609) 877-8256 Greenwich, CT 06830 email: [email protected] ©2008 by Manning Publications Co. All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by means electronic, mechanical, photocopying, or otherwise, without prior written permission of the publisher. Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in the book, and Manning Publications was aware of a trademark claim, the designations have been printed in initial caps or all caps. Recognizing the importance of preserving what has been written, it is Manning’s policy to have the books we publish printed on acid-free paper, and we exert our best efforts to that end. Recognizing also our responsibility to conserve the resources of our planet, Manning books are printed on paper that is at least 15% recycled and processed without the use of elemental chlorine. Manning Publications Co. Copyeditor: Benjamin Berg Sound View Court 3B Typesetter: Gordan Salinovic Greenwich, CT 06830 Cover designer: Leslie Haimes ISBN 1-933988-07-X
    [Show full text]