Spring Framework Reference

910 1.3K 0
Spring Framework Reference

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

Spring Framework Reference Documentation 4.3.4.RELEASE Rod Johnson , Juergen Hoeller , Keith Donald , Colin Sampaleanu , Rob Harrop , Thomas Risberg , Alef Arendsen , 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 , Phillip Webb , Rob Winch , Brian Clozel , Stephane Nicoll , Sebastien Deleuze Copyright © 2004-2016 Copies of this document may be made for your own use and for distribution to others, provided that you 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 Reference Documentation Table of Contents I Overview of Spring Framework 1 Getting Started with Spring 2 Introduction to the Spring Framework 2.1 Dependency Injection and Inversion of Control 2.2 Modules Core Container AOP and Instrumentation Messaging Data Access/Integration Web Test 2.3 Usage scenarios Dependency Management and Naming Conventions Spring Dependencies and Depending on Spring 11 Maven Dependency Management 11 Maven "Bill Of Materials" Dependency 12 Gradle Dependency Management 12 Ivy Dependency Management 13 Distribution Zip Files 13 Logging 13 Not Using Commons Logging 14 Using SLF4J 14 Using Log4J 15 II What’s New in Spring Framework 4.x 17 New Features and Enhancements in Spring Framework 4.0 18 3.1 Improved Getting Started Experience 18 3.2 Removed Deprecated Packages and Methods 18 3.3 Java (as well as and 7) 18 3.4 Java EE and 19 3.5 Groovy Bean Definition DSL 19 3.6 Core Container Improvements 19 3.7 General Web Improvements 20 3.8 WebSocket, SockJS, and STOMP Messaging 20 3.9 Testing Improvements 21 New Features and Enhancements in Spring Framework 4.1 22 4.1 JMS Improvements 22 4.2 Caching Improvements 22 4.3 Web Improvements 23 4.4 WebSocket Messaging Improvements 24 4.5 Testing Improvements 24 New Features and Enhancements in Spring Framework 4.2 26 5.1 Core Container Improvements 26 5.2 Data Access Improvements 27 5.3 JMS Improvements 28 5.4 Web Improvements 28 5.5 WebSocket Messaging Improvements 29 5.6 Testing Improvements 29 4.3.4.RELEASE Spring Framework iii Spring Framework Reference Documentation New Features and Enhancements in Spring Framework 4.3 6.1 Core Container Improvements 6.2 Data Access Improvements 6.3 Caching Improvements 6.4 JMS Improvements 6.5 Web Improvements 6.6 WebSocket Messaging Improvements 6.7 Testing Improvements 6.8 Support for new library and server generations III Core Technologies The IoC container 7.1 Introduction to the Spring IoC container and beans 7.2 Container overview Configuration metadata Instantiating a container Composing XML-based configuration metadata Using the container 7.3 Bean overview Naming beans Aliasing a bean outside the bean definition Instantiating beans Instantiation with a constructor Instantiation with a static factory method Instantiation using an instance factory method 7.4 Dependencies Dependency Injection Constructor-based dependency injection Setter-based dependency injection Dependency resolution process Examples of dependency injection Dependencies and configuration in detail Straight values (primitives, Strings, and so on) References to other beans (collaborators) Inner beans Collections Null and empty string values XML shortcut with the p-namespace XML shortcut with the c-namespace Compound property names Using depends-on Lazy-initialized beans Autowiring collaborators Limitations and disadvantages of autowiring Excluding a bean from autowiring Method injection Lookup method injection Arbitrary method replacement 7.5 Bean scopes The singleton scope The prototype scope 4.3.4.RELEASE Spring Framework 32 32 32 32 33 33 33 33 34 36 37 37 37 38 39 40 41 41 42 43 44 45 45 45 47 47 47 49 50 51 53 53 55 56 56 58 59 60 61 61 61 62 63 64 64 65 67 68 69 70 iv Spring Framework Reference Documentation Singleton beans with prototype-bean dependencies 71 Request, session, global session, application, and WebSocket scopes 71 Initial web configuration 72 Request scope 72 Session scope 73 Global session scope 73 Application scope 73 Scoped beans as dependencies 74 Custom scopes 76 Creating a custom scope 76 Using a custom scope 77 7.6 Customizing the nature of a bean 78 Lifecycle callbacks 78 Initialization callbacks 79 Destruction callbacks 79 Default initialization and destroy methods 80 Combining lifecycle mechanisms 81 Startup and shutdown callbacks 82 Shutting down the Spring IoC container gracefully in non-web applications 84 ApplicationContextAware and BeanNameAware 84 Other Aware interfaces 85 7.7 Bean definition inheritance 86 7.8 Container Extension Points 88 Customizing beans using a BeanPostProcessor 88 Example: Hello World, BeanPostProcessor-style 89 Example: The RequiredAnnotationBeanPostProcessor 91 Customizing configuration metadata with a BeanFactoryPostProcessor 91 Example: the Class name substitution PropertyPlaceholderConfigurer 92 Example: the PropertyOverrideConfigurer 93 Customizing instantiation logic with a FactoryBean 94 7.9 Annotation-based container configuration 94 @Required 96 @Autowired 96 Fine-tuning annotation-based autowiring with @Primary 99 Fine-tuning annotation-based autowiring with qualifiers 100 Using generics as autowiring qualifiers 105 CustomAutowireConfigurer 106 @Resource 106 @PostConstruct and @PreDestroy 108 7.10 Classpath scanning and managed components 108 @Component and further stereotype annotations 108 Meta-annotations 109 Automatically detecting classes and registering bean definitions 110 Using filters to customize scanning 111 Defining bean metadata within components 112 Naming autodetected components 115 Providing a scope for autodetected components 115 Providing qualifier metadata with annotations 116 7.11 Using JSR 330 Standard Annotations 117 4.3.4.RELEASE Spring Framework v Spring Framework Reference Documentation Dependency Injection with @Inject and @Named 117 @Named and @ManagedBean: standard equivalents to the @Component annotation 118 Limitations of JSR-330 standard annotations 119 7.12 Java-based container configuration 120 Basic concepts: @Bean and @Configuration 120 Instantiating the Spring container using AnnotationConfigApplicationContext 121 Simple construction 121 Building the container programmatically using register(Class…) 122 Enabling component scanning with scan(String…) 122 Support for web applications with AnnotationConfigWebApplicationContext 123 Using the @Bean annotation 124 Declaring a bean 124 Bean dependencies 125 Receiving lifecycle callbacks 125 Specifying bean scope 127 Customizing bean naming 128 Bean aliasing 128 Bean description 128 Using the @Configuration annotation 128 Injecting inter-bean dependencies 128 Lookup method injection 129 Further information about how Java-based configuration works internally 130 Composing Java-based configurations 131 Using the @Import annotation 131 Conditionally include @Configuration classes or @Bean methods 135 Combining Java and XML configuration 136 7.13 Environment abstraction 138 Bean definition profiles 138 @Profile 139 XML bean definition profiles 141 Activating a profile 141 Default profile 142 PropertySource abstraction 142 @PropertySource 143 Placeholder resolution in statements 144 7.14 Registering a LoadTimeWeaver 144 7.15 Additional Capabilities of the ApplicationContext 145 Internationalization using MessageSource 145 Standard and Custom Events 148 Annotation-based Event Listeners 151 Asynchronous Listeners 153 Ordering Listeners 153 Generic Events 153 Convenient access to low-level resources 154 Convenient ApplicationContext instantiation for web applications 154 Deploying a Spring ApplicationContext as a Java EE RAR file 155 7.16 The BeanFactory 155 BeanFactory or ApplicationContext? 156 4.3.4.RELEASE Spring Framework vi Spring Framework Reference Documentation Glue code and the evil singleton Resources 8.1 Introduction 8.2 The Resource interface 8.3 Built-in Resource implementations UrlResource ClassPathResource FileSystemResource ServletContextResource InputStreamResource ByteArrayResource 8.4 The ResourceLoader 8.5 The ResourceLoaderAware interface 8.6 Resources as dependencies 8.7 Application contexts and Resource paths Constructing application contexts Constructing ClassPathXmlApplicationContext instances - shortcuts Wildcards in application context constructor resource paths Ant-style Patterns The Classpath*: portability classpath*: prefix Other notes relating to wildcards FileSystemResource caveats Validation, Data Binding, and Type Conversion 9.1 Introduction 9.2 Validation using Spring’s Validator interface 9.3 Resolving codes to error messages 9.4 Bean manipulation and the BeanWrapper Setting and getting basic and nested properties Built-in PropertyEditor implementations Registering additional custom PropertyEditors 9.5 Spring Type Conversion Converter SPI ConverterFactory GenericConverter ConditionalGenericConverter ConversionService API Configuring a ConversionService Using a ConversionService programmatically 9.6 Spring Field Formatting Formatter SPI Annotation-driven Formatting Format Annotation API FormatterRegistry SPI FormatterRegistrar SPI Configuring Formatting in Spring MVC 9.7 Configuring a global date & time format 9.8 Spring Validation Overview of the JSR-303 Bean Validation API Configuring a Bean Validation Provider Injecting a Validator 4.3.4.RELEASE Spring Framework 157 158 158 158 159 159 159 160 160 160 160 160 161 162 162 162 163 163 164 164 165 165 167 167 167 169 170 170 172 175 177 177 178 178 179 179 180 181 181 182 183 184 184 185 185 185 187 187 187 188 vii Spring Framework Reference Documentation Configuring Custom Constraints Spring-driven Method Validation Additional Configuration Options Configuring a DataBinder Spring MVC Validation 10 Spring Expression Language (SpEL) 10.1 Introduction 10.2 Feature Overview 10.3 Expression Evaluation using Spring’s Expression Interface The EvaluationContext interface Type Conversion Parser configuration SpEL compilation Compiler configuration Compiler limitations 10.4 Expression support for defining bean definitions XML based configuration Annotation-based configuration 10.5 Language Reference Literal expressions Properties, Arrays, Lists, Maps, Indexers Inline lists Inline Maps Array construction Methods Operators Relational operators Logical operators Mathematical operators Assignment Types Constructors Variables The #this and #root variables Functions Bean references Ternary Operator (If-Then-Else) The Elvis Operator Safe Navigation operator Collection Selection Collection Projection Expression templating 10.6 Classes used in the examples 11 Aspect Oriented Programming with Spring 11.1 Introduction AOP concepts Spring AOP capabilities and goals AOP Proxies 11.2 @AspectJ support Enabling @AspectJ Support 4.3.4.RELEASE Spring Framework 188 189 189 189 190 191 191 191 192 194 194 195 195 196 197 197 197 198 199 199 199 200 200 201 201 201 201 202 202 203 203 203 204 204 204 205 205 205 206 206 207 207 208 212 212 212 214 215 215 215 viii Spring Framework Reference Documentation Enabling @AspectJ Support with Java configuration Enabling @AspectJ Support with XML configuration Declaring an aspect Declaring a pointcut Supported Pointcut Designators Combining pointcut expressions Sharing common pointcut definitions Examples Writing good pointcuts Declaring advice Before advice After returning advice After throwing advice After (finally) advice Around advice Advice parameters Advice ordering Introductions Aspect instantiation models Example 11.3 Schema-based AOP support Declaring an aspect Declaring a pointcut Declaring advice Before advice After returning advice After throwing advice After (finally) advice Around advice Advice parameters Advice ordering Introductions Aspect instantiation models Advisors Example 11.4 Choosing which AOP declaration style to use Spring AOP or full AspectJ? @AspectJ or XML for Spring AOP? 11.5 Mixing aspect types 11.6 Proxying mechanisms Understanding AOP proxies 11.7 Programmatic creation of @AspectJ Proxies 11.8 Using AspectJ with Spring applications Using AspectJ to dependency inject domain objects with Spring Unit testing @Configurable objects Working with multiple application contexts Other Spring aspects for AspectJ Configuring AspectJ aspects using Spring IoC Load-time weaving with AspectJ in the Spring Framework A first example 4.3.4.RELEASE Spring Framework 215 216 216 217 217 219 219 221 223 224 224 224 225 226 226 227 230 231 231 232 234 234 235 236 236 237 237 238 238 239 240 241 241 241 242 244 244 245 245 246 246 249 249 249 252 252 252 253 254 254 ix Spring Framework Reference Documentation Aspects 'META-INF/aop.xml' Required libraries (JARS) Spring configuration Environment-specific configuration 11.9 Further Resources 12 Spring AOP APIs 12.1 Introduction 12.2 Pointcut API in Spring Concepts Operations on pointcuts AspectJ expression pointcuts Convenience pointcut implementations Static pointcuts Dynamic pointcuts Pointcut superclasses Custom pointcuts 12.3 Advice API in Spring Advice lifecycles Advice types in Spring Interception around advice Before advice Throws advice After Returning advice Introduction advice 12.4 Advisor API in Spring 12.5 Using the ProxyFactoryBean to create AOP proxies Basics JavaBean properties JDK- and CGLIB-based proxies Proxying interfaces Proxying classes Using 'global' advisors 12.6 Concise proxy definitions 12.7 Creating AOP proxies programmatically with the ProxyFactory 12.8 Manipulating advised objects 12.9 Using the "auto-proxy" facility Autoproxy bean definitions BeanNameAutoProxyCreator DefaultAdvisorAutoProxyCreator AbstractAdvisorAutoProxyCreator Using metadata-driven auto-proxying 12.10 Using TargetSources Hot swappable target sources Pooling target sources Prototype target sources ThreadLocal target sources 12.11 Defining new Advice types 12.12 Further resources IV Testing 4.3.4.RELEASE Spring Framework 257 257 258 258 260 262 263 263 263 263 264 264 264 264 265 266 266 266 266 266 266 267 268 269 270 272 272 272 273 274 274 276 277 277 278 279 280 280 280 281 282 282 284 284 284 286 286 286 287 288 x Spring Framework Reference Documentation Attribute Required? Runtime Expression? Description onmouseup false true HTML Event Attribute path true true Path to property for data binding tabindex false true HTML Standard Attribute title false true HTML Standard Attribute value false true HTML Optional Attribute 44.4 The checkboxes tag Renders multiple HTML 'input' tags with type 'checkbox' Table 44.3 Attributes Attribute Required? Runtime Expression? Description accesskey false true HTML Standard Attribute cssClass false true Equivalent to "class" - HTML Optional Attribute cssErrorClass false true Equivalent to "class" - HTML Optional Attribute Used when the bound field has errors cssStyle false true Equivalent to "style" - HTML Optional Attribute delimiter false true Delimiter to use between each 'input' tag with type 'checkbox' There is no delimiter by default dir false true HTML Standard Attribute disabled false true HTML Optional Attribute Setting the value of this attribute to 'true' will disable the HTML element element false true Specifies the HTML element that is used to enclose each 'input' tag with type 'checkbox' Defaults to 'span' htmlEscape false true Enable/disable HTML escaping of rendered values id false true HTML Standard Attribute itemLabel false true Value to be displayed as part of the 'input' tags with type 'checkbox' items true true The Collection, Map or array of objects used to generate the 'input' tags with type 'checkbox' itemValue false true Name of the property mapped to 'value' attribute of the 'input' tags with type 'checkbox' lang false true HTML Standard Attribute 4.3.4.RELEASE Spring Framework 867 Spring Framework Reference Documentation Attribute Required? Runtime Expression? Description onblur false true HTML Event Attribute onchange false true HTML Event Attribute onclick false true HTML Event Attribute ondblclick false true HTML Event Attribute onfocus false true HTML Event Attribute onkeydown false true HTML Event Attribute onkeypress false true HTML Event Attribute onkeyup false true HTML Event Attribute onmousedown false true HTML Event Attribute onmousemove false true HTML Event Attribute onmouseout false true HTML Event Attribute onmouseover false true HTML Event Attribute onmouseup false true HTML Event Attribute path true true Path to property for data binding tabindex false true HTML Standard Attribute title false true HTML Standard Attribute 44.5 The errors tag Renders field errors in an HTML 'span' tag Table 44.4 Attributes Attribute Required? Runtime Expression? Description cssClass false true Equivalent to "class" - HTML Optional Attribute cssStyle false true Equivalent to "style" - HTML Optional Attribute delimiter false true Delimiter for displaying multiple error messages Defaults to the br tag dir false true HTML Standard Attribute element false true Specifies the HTML element that is used to render the enclosing errors htmlEscape false true Enable/disable HTML escaping of rendered values id false true HTML Standard Attribute 4.3.4.RELEASE Spring Framework 868 Spring Framework Reference Documentation Attribute Required? Runtime Expression? Description lang false true HTML Standard Attribute onclick false true HTML Event Attribute ondblclick false true HTML Event Attribute onkeydown false true HTML Event Attribute onkeypress false true HTML Event Attribute onkeyup false true HTML Event Attribute onmousedown false true HTML Event Attribute onmousemove false true HTML Event Attribute onmouseout false true HTML Event Attribute onmouseover false true HTML Event Attribute onmouseup false true HTML Event Attribute path false true Path to errors object for data binding tabindex false true HTML Standard Attribute title false true HTML Standard Attribute 44.6 The form tag Renders an HTML 'form' tag and exposes a binding path to inner tags for binding Table 44.5 Attributes Attribute Runtime Expression? Description acceptCharset false true Specifies the list of character encodings for input data that is accepted by the server processing this form The value is a space- and/or commadelimited list of charset values The client must interpret this list as an exclusive-or list, i.e., the server is able to accept any single character encoding per entity received action false true HTML Required Attribute cssClass false true Equivalent to "class" - HTML Optional Attribute cssStyle false true Equivalent to "style" - HTML Optional Attribute dir false true HTML Standard Attribute enctype false true HTML Optional Attribute 4.3.4.RELEASE Required? Spring Framework 869 Spring Framework Reference Documentation Attribute Required? Runtime Expression? Description htmlEscape false true Enable/disable HTML escaping of rendered values id false true HTML Standard Attribute lang false true HTML Standard Attribute method false true HTML Optional Attribute methodParam false true The parameter name used for HTTP methods other then GET and POST Default is '_method' modelAttribute false true Name of the model attribute under which the form object is exposed Defaults to 'command' name false true HTML Standard Attribute - added for backwards compatibility cases onclick false true HTML Event Attribute ondblclick false true HTML Event Attribute onkeydown false true HTML Event Attribute onkeypress false true HTML Event Attribute onkeyup false true HTML Event Attribute onmousedown false true HTML Event Attribute onmousemove false true HTML Event Attribute onmouseout false true HTML Event Attribute onmouseover false true HTML Event Attribute onmouseup false true HTML Event Attribute onreset false true HTML Event Attribute onsubmit false true HTML Event Attribute servletRelativeAction false true Action reference to be appended to the current servlet path target false true HTML Optional Attribute title false true HTML Standard Attribute 44.7 The hidden tag Renders an HTML 'input' tag with type 'hidden' using the bound value 4.3.4.RELEASE Spring Framework 870 Spring Framework Reference Documentation Table 44.6 Attributes Attribute Required? Runtime Expression? Description htmlEscape false true Enable/disable HTML escaping of rendered values id false true HTML Standard Attribute path true true Path to property for data binding 44.8 The input tag Renders an HTML 'input' tag with type 'text' using the bound value Table 44.7 Attributes Attribute Required? Runtime Expression? Description accesskey false true HTML Standard Attribute alt false true HTML Optional Attribute autocomplete false true Common Optional Attribute cssClass false true Equivalent to "class" - HTML Optional Attribute cssErrorClass false true Equivalent to "class" - HTML Optional Attribute Used when the bound field has errors cssStyle false true Equivalent to "style" - HTML Optional Attribute dir false true HTML Standard Attribute disabled false true HTML Optional Attribute Setting the value of this attribute to 'true' will disable the HTML element htmlEscape false true Enable/disable HTML escaping of rendered values id false true HTML Standard Attribute lang false true HTML Standard Attribute maxlength false true HTML Optional Attribute onblur false true HTML Event Attribute onchange false true HTML Event Attribute onclick false true HTML Event Attribute ondblclick false true HTML Event Attribute onfocus false true HTML Event Attribute onkeydown false true HTML Event Attribute 4.3.4.RELEASE Spring Framework 871 Spring Framework Reference Documentation Attribute Required? Runtime Expression? Description onkeypress false true HTML Event Attribute onkeyup false true HTML Event Attribute onmousedown false true HTML Event Attribute onmousemove false true HTML Event Attribute onmouseout false true HTML Event Attribute onmouseover false true HTML Event Attribute onmouseup false true HTML Event Attribute onselect false true HTML Event Attribute path true true Path to property for data binding readonly false true HTML Optional Attribute Setting the value of this attribute to 'true' will make the HTML element readonly size false true HTML Optional Attribute tabindex false true HTML Standard Attribute title false true HTML Standard Attribute 44.9 The label tag Renders a form field label in an HTML 'label' tag Table 44.8 Attributes Attribute Required? Runtime Expression? Description cssClass false true Equivalent to "class" - HTML Optional Attribute cssErrorClass false true Equivalent to "class" - HTML Optional Attribute Used only when errors are present cssStyle false true Equivalent to "style" - HTML Optional Attribute dir false true HTML Standard Attribute for false true HTML Standard Attribute htmlEscape false true Enable/disable HTML escaping of rendered values id false true HTML Standard Attribute lang false true HTML Standard Attribute onclick false true HTML Event Attribute 4.3.4.RELEASE Spring Framework 872 Spring Framework Reference Documentation Attribute Required? Runtime Expression? Description ondblclick false true HTML Event Attribute onkeydown false true HTML Event Attribute onkeypress false true HTML Event Attribute onkeyup false true HTML Event Attribute onmousedown false true HTML Event Attribute onmousemove false true HTML Event Attribute onmouseout false true HTML Event Attribute onmouseover false true HTML Event Attribute onmouseup false true HTML Event Attribute path true true Path to errors object for data binding tabindex false true HTML Standard Attribute title false true HTML Standard Attribute 44.10 The option tag Renders a single HTML 'option' Sets 'selected' as appropriate based on bound value Table 44.9 Attributes Attribute Required? Runtime Expression? Description cssClass false true Equivalent to "class" - HTML Optional Attribute cssErrorClass false true Equivalent to "class" - HTML Optional Attribute Used when the bound field has errors cssStyle false true Equivalent to "style" - HTML Optional Attribute dir false true HTML Standard Attribute disabled false true HTML Optional Attribute Setting the value of this attribute to 'true' will disable the HTML element htmlEscape false true Enable/disable HTML escaping of rendered values id false true HTML Standard Attribute label false true HTML Optional Attribute lang false true HTML Standard Attribute onclick false true HTML Event Attribute ondblclick false true HTML Event Attribute 4.3.4.RELEASE Spring Framework 873 Spring Framework Reference Documentation Attribute Required? Runtime Expression? Description onkeydown false true HTML Event Attribute onkeypress false true HTML Event Attribute onkeyup false true HTML Event Attribute onmousedown false true HTML Event Attribute onmousemove false true HTML Event Attribute onmouseout false true HTML Event Attribute onmouseover false true HTML Event Attribute onmouseup false true HTML Event Attribute tabindex false true HTML Standard Attribute title false true HTML Standard Attribute value true true HTML Optional Attribute 44.11 The options tag Renders a list of HTML 'option' tags Sets 'selected' as appropriate based on bound value Table 44.10 Attributes Attribute Required? Runtime Expression? Description cssClass false true Equivalent to "class" - HTML Optional Attribute cssErrorClass false true Equivalent to "class" - HTML Optional Attribute Used when the bound field has errors cssStyle false true Equivalent to "style" - HTML Optional Attribute dir false true HTML Standard Attribute disabled false true HTML Optional Attribute Setting the value of this attribute to 'true' will disable the HTML element htmlEscape false true Enable/disable HTML escaping of rendered values id false true HTML Standard Attribute itemLabel false true Name of the property mapped to the inner text of the 'option' tag items true true The Collection, Map or array of objects used to generate the inner 'option' tags itemValue false true Name of the property mapped to 'value' attribute of the 'option' tag 4.3.4.RELEASE Spring Framework 874 Spring Framework Reference Documentation Attribute Required? Runtime Expression? Description lang false true HTML Standard Attribute onclick false true HTML Event Attribute ondblclick false true HTML Event Attribute onkeydown false true HTML Event Attribute onkeypress false true HTML Event Attribute onkeyup false true HTML Event Attribute onmousedown false true HTML Event Attribute onmousemove false true HTML Event Attribute onmouseout false true HTML Event Attribute onmouseover false true HTML Event Attribute onmouseup false true HTML Event Attribute tabindex false true HTML Standard Attribute title false true HTML Standard Attribute 44.12 The password tag Renders an HTML 'input' tag with type 'password' using the bound value Table 44.11 Attributes Attribute Required? Runtime Expression? Description accesskey false true HTML Standard Attribute alt false true HTML Optional Attribute autocomplete false true Common Optional Attribute cssClass false true Equivalent to "class" - HTML Optional Attribute cssErrorClass false true Equivalent to "class" - HTML Optional Attribute Used when the bound field has errors cssStyle false true Equivalent to "style" - HTML Optional Attribute dir false true HTML Standard Attribute disabled false true HTML Optional Attribute Setting the value of this attribute to 'true' will disable the HTML element htmlEscape false true Enable/disable HTML escaping of rendered values id false true HTML Standard Attribute 4.3.4.RELEASE Spring Framework 875 Spring Framework Reference Documentation Attribute Required? Runtime Expression? Description lang false true HTML Standard Attribute maxlength false true HTML Optional Attribute onblur false true HTML Event Attribute onchange false true HTML Event Attribute onclick false true HTML Event Attribute ondblclick false true HTML Event Attribute onfocus false true HTML Event Attribute onkeydown false true HTML Event Attribute onkeypress false true HTML Event Attribute onkeyup false true HTML Event Attribute onmousedown false true HTML Event Attribute onmousemove false true HTML Event Attribute onmouseout false true HTML Event Attribute onmouseover false true HTML Event Attribute onmouseup false true HTML Event Attribute onselect false true HTML Event Attribute path true true Path to property for data binding readonly false true HTML Optional Attribute Setting the value of this attribute to 'true' will make the HTML element readonly showPassword false true Is the password value to be shown? Defaults to false size false true HTML Optional Attribute tabindex false true HTML Standard Attribute title false true HTML Standard Attribute 44.13 The radiobutton tag Renders an HTML 'input' tag with type 'radio' Table 44.12 Attributes Attribute Required? Runtime Expression? Description accesskey false true HTML Standard Attribute 4.3.4.RELEASE Spring Framework 876 Spring Framework Reference Documentation Attribute Required? Runtime Expression? Description cssClass false true Equivalent to "class" - HTML Optional Attribute cssErrorClass false true Equivalent to "class" - HTML Optional Attribute Used when the bound field has errors cssStyle false true Equivalent to "style" - HTML Optional Attribute dir false true HTML Standard Attribute disabled false true HTML Optional Attribute Setting the value of this attribute to 'true' will disable the HTML element htmlEscape false true Enable/disable HTML escaping of rendered values id false true HTML Standard Attribute label false true Value to be displayed as part of the tag lang false true HTML Standard Attribute onblur false true HTML Event Attribute onchange false true HTML Event Attribute onclick false true HTML Event Attribute ondblclick false true HTML Event Attribute onfocus false true HTML Event Attribute onkeydown false true HTML Event Attribute onkeypress false true HTML Event Attribute onkeyup false true HTML Event Attribute onmousedown false true HTML Event Attribute onmousemove false true HTML Event Attribute onmouseout false true HTML Event Attribute onmouseover false true HTML Event Attribute onmouseup false true HTML Event Attribute path true true Path to property for data binding tabindex false true HTML Standard Attribute title false true HTML Standard Attribute value false true HTML Optional Attribute 4.3.4.RELEASE Spring Framework 877 Spring Framework Reference Documentation 44.14 The radiobuttons tag Renders multiple HTML 'input' tags with type 'radio' Table 44.13 Attributes Attribute Required? Runtime Expression? Description accesskey false true HTML Standard Attribute cssClass false true Equivalent to "class" - HTML Optional Attribute cssErrorClass false true Equivalent to "class" - HTML Optional Attribute Used when the bound field has errors cssStyle false true Equivalent to "style" - HTML Optional Attribute delimiter false true Delimiter to use between each 'input' tag with type 'radio' There is no delimiter by default dir false true HTML Standard Attribute disabled false true HTML Optional Attribute Setting the value of this attribute to 'true' will disable the HTML element element false true Specifies the HTML element that is used to enclose each 'input' tag with type 'radio' Defaults to 'span' htmlEscape false true Enable/disable HTML escaping of rendered values id false true HTML Standard Attribute itemLabel false true Value to be displayed as part of the 'input' tags with type 'radio' items true true The Collection, Map or array of objects used to generate the 'input' tags with type 'radio' itemValue false true Name of the property mapped to 'value' attribute of the 'input' tags with type 'radio' lang false true HTML Standard Attribute onblur false true HTML Event Attribute onchange false true HTML Event Attribute onclick false true HTML Event Attribute ondblclick false true HTML Event Attribute onfocus false true HTML Event Attribute onkeydown false true HTML Event Attribute onkeypress false true HTML Event Attribute 4.3.4.RELEASE Spring Framework 878 Spring Framework Reference Documentation Attribute Required? Runtime Expression? Description onkeyup false true HTML Event Attribute onmousedown false true HTML Event Attribute onmousemove false true HTML Event Attribute onmouseout false true HTML Event Attribute onmouseover false true HTML Event Attribute onmouseup false true HTML Event Attribute path true true Path to property for data binding tabindex false true HTML Standard Attribute title false true HTML Standard Attribute 44.15 The select tag Renders an HTML 'select' element Supports databinding to the selected option Table 44.14 Attributes Attribute Required? Runtime Expression? Description accesskey false true HTML Standard Attribute cssClass false true Equivalent to "class" - HTML Optional Attribute cssErrorClass false true Equivalent to "class" - HTML Optional Attribute Used when the bound field has errors cssStyle false true Equivalent to "style" - HTML Optional Attribute dir false true HTML Standard Attribute disabled false true HTML Optional Attribute Setting the value of this attribute to 'true' will disable the HTML element htmlEscape false true Enable/disable HTML escaping of rendered values id false true HTML Standard Attribute itemLabel false true Name of the property mapped to the inner text of the 'option' tag items false true The Collection, Map or array of objects used to generate the inner 'option' tags itemValue false true Name of the property mapped to 'value' attribute of the 'option' tag lang false true HTML Standard Attribute 4.3.4.RELEASE Spring Framework 879 Spring Framework Reference Documentation Attribute Required? Runtime Expression? Description multiple false true HTML Optional Attribute onblur false true HTML Event Attribute onchange false true HTML Event Attribute onclick false true HTML Event Attribute ondblclick false true HTML Event Attribute onfocus false true HTML Event Attribute onkeydown false true HTML Event Attribute onkeypress false true HTML Event Attribute onkeyup false true HTML Event Attribute onmousedown false true HTML Event Attribute onmousemove false true HTML Event Attribute onmouseout false true HTML Event Attribute onmouseover false true HTML Event Attribute onmouseup false true HTML Event Attribute path true true Path to property for data binding size false true HTML Optional Attribute tabindex false true HTML Standard Attribute title false true HTML Standard Attribute 44.16 The textarea tag Renders an HTML 'textarea' Table 44.15 Attributes Attribute Required? Runtime Expression? Description accesskey false true HTML Standard Attribute cols false true HTML Required Attribute cssClass false true Equivalent to "class" - HTML Optional Attribute cssErrorClass false true Equivalent to "class" - HTML Optional Attribute Used when the bound field has errors cssStyle false true Equivalent to "style" - HTML Optional Attribute dir false true HTML Standard Attribute 4.3.4.RELEASE Spring Framework 880 Spring Framework Reference Documentation Attribute Required? Runtime Expression? Description disabled false true HTML Optional Attribute Setting the value of this attribute to 'true' will disable the HTML element htmlEscape false true Enable/disable HTML escaping of rendered values id false true HTML Standard Attribute lang false true HTML Standard Attribute onblur false true HTML Event Attribute onchange false true HTML Event Attribute onclick false true HTML Event Attribute ondblclick false true HTML Event Attribute onfocus false true HTML Event Attribute onkeydown false true HTML Event Attribute onkeypress false true HTML Event Attribute onkeyup false true HTML Event Attribute onmousedown false true HTML Event Attribute onmousemove false true HTML Event Attribute onmouseout false true HTML Event Attribute onmouseover false true HTML Event Attribute onmouseup false true HTML Event Attribute onselect false true HTML Event Attribute path true true Path to property for data binding readonly false true HTML Optional Attribute Setting the value of this attribute to 'true' will make the HTML element readonly rows false true HTML Required Attribute tabindex false true HTML Standard Attribute title false true HTML Standard Attribute 4.3.4.RELEASE Spring Framework 881 ... electronically Spring Framework Reference Documentation Table of Contents I Overview of Spring Framework 1 Getting Started with Spring 2 Introduction to the Spring Framework. .. Testing Improvements 29 4.3.4.RELEASE Spring Framework iii Spring Framework Reference Documentation New Features and Enhancements in Spring Framework 4.3 6.1 Core Container Improvements... 403 19.1 Introduction to Spring Framework JDBC 403 Choosing an approach for JDBC database access 403 4.3.4.RELEASE Spring Framework xiii Spring Framework Reference Documentation Package

Ngày đăng: 30/11/2017, 23:30

Mục lục

    Spring Framework Reference Documentation

    Part I. Overview of Spring Framework

    1. Getting Started with Spring

    2. Introduction to the Spring Framework

    2.1 Dependency Injection and Inversion of Control

    Dependency Management and Naming Conventions

    Spring Dependencies and Depending on Spring

    Maven "Bill Of Materials" Dependency

    Not Using Commons Logging

    Runtime Containers with Native JCL

Tài liệu cùng người dùng

Tài liệu liên quan