Spring
Why Spring
Overview Microservices Reactive Event Driven Cloud Web Applications Serverless Batch
Learn
Overview Quickstart Guides Blog
Projects
Overview Spring Boot Spring Framework Spring Cloud Spring Cloud Data Flow Spring Data Spring Integration Spring Batch Spring Security View all projects Spring Tools 4 Spring Initializr
Academy
Courses Get Certified
Solutions
Overview Spring Runtime Spring Consulting Spring Academy For Teams Security Advisories
Community
Overview Events Team
Spring Framework 6.1.5
    • 概述
    • 核心技术
      • IoC容器
        • Spring IoC容器和Bean简介
        • 容器概述
        • Bean概述
        • 依赖关系
          • 依赖注入
          • 详细的依赖关系和配置
          • 使用depends-on
          • 延迟初始化的Bean
          • 自动装配协作者
          • 方法注入
        • Bean作用域
        • 自定义Bean的性质
        • Bean定义继承
        • 容器扩展点
        • 基于注解的容器配置
          • 使用@Autowired
          • 使用@Primary进行微调基于注解的自动装配
          • 使用限定符微调基于注解的自动装配
          • 使用泛型作为自动装配限定符
          • 使用CustomAutowireConfigurer
          • 使用@Resource进行注入
          • 使用@Value
          • 使用@PostConstruct和@PreDestroy
        • 类路径扫描和受管组件
        • 使用JSR 330标准注解
        • 基于Java的容器配置
          • 基本概念:@Bean和@Configuration
          • 使用AnnotationConfigApplicationContext实例化Spring容器
          • 使用@Bean注解
          • 使用@Configuration注解
          • 组合基于Java的配置
        • 环境抽象
        • 注册LoadTimeWeaver
        • ApplicationContext的附加功能
        • BeanFactory API
      • 资源
      • 验证、数据绑定和类型转换
        • 使用Spring的验证器接口进行验证
        • 数据绑定
        • 将代码解析为错误消息
        • Spring类型转换
        • Spring字段格式化
        • 配置全局日期和时间格式
        • Java Bean验证
      • Spring表达式语言(SpEL)
        • 表达式求值
        • Bean定义中的表达式
        • 语言参考
          • 字面表达式
          • 属性、数组、列表、映射和索引器
          • 内联列表
          • 内联映射
          • 数组构造
          • 方法
          • 操作符
          • 类型
          • 构造函数
          • 变量
          • 函数
          • Bean引用
          • 三元运算符(If-Then-Else)
          • Elvis运算符
          • 安全导航运算符
          • 集合选择
          • 集合投影
          • 表达式模板化
        • 示例中使用的类
      • Spring中的面向切面编程
        • AOP概念
        • Spring AOP的能力和目标
        • AOP代理
        • @AspectJ支持
          • 启用@AspectJ支持
          • 声明一个切面
          • 声明一个切入点
          • 声明通知
          • 引介
          • 切面实例化模型
          • 一个AOP示例
        • 基于模式的AOP支持
        • 选择使用哪种AOP声明风格
        • 混合切面类型
        • 代理机制
        • 使用@AspectJ代理的编程创建
        • 在Spring应用中使用AspectJ
        • 更多资源
      • Spring AOP API
        • Spring中的切入点API
        • Spring中的通知API
        • Spring中的Advisor API
        • 使用ProxyFactoryBean创建AOP代理
        • 简洁的代理定义
        • 使用ProxyFactory以编程方式创建AOP代理
        • 操作被通知的对象
        • 使用"自动代理"功能
        • 使用TargetSource实现
        • 定义新的通知类型
      • 空安全性
      • 数据缓冲区和编解码器
      • 日志记录
      • 预先优化
      • 附录
        • XML模式
        • XML模式编写
        • 应用启动步骤
    • 测试
      • Spring测试简介
      • 单元测试
      • 集成测试
      • JDBC测试支持
      • Spring TestContext框架
        • 关键抽象
        • 启动TestContext框架
        • TestExecutionListener配置
        • 应用事件
        • 测试执行事件
        • 上下文管理
          • 使用XML资源进行上下文配置
          • 使用Groovy脚本进行上下文配置
          • 使用组件类进行上下文配置
          • 混合XML、Groovy脚本和组件类
          • 使用上下文定制器进行配置
          • 使用上下文初始化器进行上下文配置
          • 上下文配置继承
          • 使用环境配置文件进行上下文配置
          • 使用测试属性源进行上下文配置
          • 使用动态属性源进行上下文配置
          • 加载WebApplicationContext
          • 使用Web Mocks
          • 上下文缓存
          • 上下文失败阈值
          • 上下文层次结构
        • 测试夹具的依赖注入
        • 测试请求和会话作用域的Bean
        • 事务管理
        • 执行SQL脚本
        • 并行测试执行
        • TestContext框架支持类
        • 测试的预先支持
      • WebTestClient
      • MockMvc
        • 概述
        • 静态导入
        • 设置选项
        • 设置功能
        • 执行请求
        • 定义期望
        • 异步请求
        • 流式响应
        • 过滤器注册
        • MockMvc vs 端到端测试
        • 更多示例
        • HtmlUnit集成
          • 为什么使用HtmlUnit集成?
          • MockMvc和HtmlUnit
          • MockMvc和WebDriver
          • MockMvc和Geb
      • 测试客户端应用程序
      • 附录
        • 注解
          • 标准注解支持
          • Spring测试注解
            • @BootstrapWith
            • @ContextConfiguration
            • @WebAppConfiguration
            • @ContextHierarchy
            • @ContextCustomizerFactories
            • @ActiveProfiles
            • @TestPropertySource
            • @DynamicPropertySource
            • @DirtiesContext
            • @TestExecutionListeners
            • @RecordApplicationEvents
            • @Commit
            • @Rollback
            • @BeforeTransaction
            • @AfterTransaction
            • @Sql
            • @SqlConfig
            • @SqlMergeMode
            • @SqlGroup
            • @DisabledInAotMode
          • Spring JUnit 4 Testing Annotations
          • Spring JUnit Jupiter Testing Annotations
          • Meta-Annotation Support for Testing
        • Further Resources
    • Data Access
      • Transaction Management
        • Advantages of the Spring Framework’s Transaction Support Model
        • Understanding the Spring Framework Transaction Abstraction
        • Synchronizing Resources with Transactions
        • Declarative Transaction Management
          • Understanding the Spring Framework’s Declarative Transaction Implementation
          • Example of Declarative Transaction Implementation
          • Rolling Back a Declarative Transaction
          • Configuring Different Transactional Semantics for Different Beans
          • <tx:advice/> Settings
          • Using @Transactional
          • Transaction Propagation
          • Advising Transactional Operations
          • Using @Transactional with AspectJ
        • Programmatic Transaction Management
        • Choosing Between Programmatic and Declarative Transaction Management
        • Transaction-bound Events
        • Application server-specific integration
        • Solutions to Common Problems
        • Further Resources
      • DAO Support
      • Data Access with JDBC
        • Choosing an Approach for JDBC Database Access
        • Package Hierarchy
        • Using the JDBC Core Classes to Control Basic JDBC Processing and Error Handling
        • Controlling Database Connections
        • JDBC Batch Operations
        • Simplifying JDBC Operations with the SimpleJdbc Classes
        • Modeling JDBC Operations as Java Objects
        • Common Problems with Parameter and Data Value Handling
        • Embedded Database Support
        • Initializing a DataSource
      • R2DBC数据访问
      • 对象关系映射(ORM)数据访问
        • Spring中的ORM简介
        • 通用ORM集成考虑事项
        • Hibernate
        • JPA
      • 使用对象-XML映射器进行XML编组
      • 附录
    • Servlet堆栈上的Web
      • Spring Web MVC
        • DispatcherServlet
          • 上下文层次结构
          • 特殊Bean类型
          • Web MVC配置
          • Servlet配置
          • 处理
          • 路径匹配
          • 拦截
          • 异常
          • 视图解析
          • 区域设置
          • 主题
          • 多部分解析器
          • 日志记录
        • 过滤器
        • 注释控制器
          • 声明
          • 映射请求
          • 处理程序方法
            • 方法参数
            • 返回值
            • 类型转换
            • 矩阵变量
            • @RequestParam
            • @RequestHeader
            • @CookieValue
            • @ModelAttribute
            • @SessionAttributes
            • @SessionAttribute
            • @RequestAttribute
            • 重定向属性
            • Flash属性
            • 多部分
            • @RequestBody
            • HttpEntity
            • @ResponseBody
            • ResponseEntity
            • Jackson JSON
          • 模型
          • @InitBinder
          • 验证
          • 异常
          • 控制器建议
        • 功能端点
        • URI链接
        • 异步请求
        • CORS
        • 错误响应
        • Web安全
        • HTTP缓存
        • 视图技术
          • Thymeleaf
          • FreeMarker
          • Groovy Markup
          • Script Views
          • JSP and JSTL
          • RSS and Atom
          • PDF and Excel
          • Jackson
          • XML Marshalling
          • XSLT Views
        • MVC Config
          • Enable MVC Configuration
          • MVC Config API
          • Type Conversion
          • Validation
          • Interceptors
          • Content Types
          • Message Converters
          • View Controllers
          • View Resolvers
          • Static Resources
          • Default Servlet
          • Path Matching
          • Advanced Java Config
          • Advanced XML Config
        • HTTP/2
      • REST Clients
      • Testing
      • WebSockets
        • WebSocket API
        • SockJS Fallback
        • STOMP
          • Overview
          • Benefits
          • Enable STOMP
          • WebSocket Transport
          • Flow of Messages
          • Annotated Controllers
          • Sending Messages
          • Simple Broker
          • External Broker
          • Connecting to a Broker
          • Dots as Separators
          • Authentication
          • Token Authentication
          • Authorization
          • User Destinations
          • Order of Messages
          • Events
          • Interception
          • STOMP Client
          • WebSocket Scope
          • Performance
          • Monitoring
          • Testing
      • Other Web Frameworks
    • Web on Reactive Stack
      • Spring WebFlux
        • Overview
        • Reactive Core
        • DispatcherHandler
        • Annotated Controllers
          • @Controller
          • Mapping Requests
          • Handler Methods
            • Method Arguments
            • Return Values
            • Type Conversion
            • Matrix Variables
            • @RequestParam
            • @RequestHeader
            • @CookieValue
            • @ModelAttribute
            • @SessionAttributes
            • @SessionAttribute
            • @RequestAttribute
            • Multipart Content
            • @RequestBody
            • HttpEntity
            • @ResponseBody
            • ResponseEntity
            • Jackson JSON
          • Model
          • DataBinder
          • Validation
          • Exceptions
          • Controller Advice
        • Functional Endpoints
        • URI Links
        • CORS
        • Error Responses
        • Web Security
        • HTTP Caching
        • View Technologies
        • WebFlux Config
        • HTTP/2
      • WebClient
        • Configuration
        • retrieve()
        • Exchange
        • Request Body
        • Filters
        • Attributes
        • Context
        • Synchronous Use
        • Testing
      • HTTP Interface Client
      • WebSockets
      • Testing
      • RSocket
      • Reactive Libraries
    • Integration
      • REST Clients
      • JMS (Java Message Service)
        • Using Spring JMS
        • Sending a Message
        • Receiving a Message
        • Support for JCA Message Endpoints
        • Annotation-driven Listener Endpoints
        • JMS Namespace Support
      • JMX
        • Exporting Your Beans to JMX
        • Controlling the Management Interface of Your Beans
        • Controlling ObjectName Instances for Your Beans
        • Using JSR-160 Connectors
        • Accessing MBeans through Proxies
        • Notifications
        • Further Resources
      • Email
      • Task Execution and Scheduling
      • 缓存抽象
        • 理解缓存抽象
        • 声明式基于注解的缓存
        • JCache (JSR-107) 注解
        • 基于XML的声明式缓存
        • 配置缓存存储
        • 插入不同的后端缓存
        • 如何设置TTL/TTI/驱逐策略/XXX特性?
      • 可观测性支持
      • JVM 检查点恢复
      • CDS
      • 附录
    • 语言支持
      • Kotlin
        • 要求
        • 扩展
        • 空安全
        • 类和接口
        • 注解
        • Bean 定义 DSL
        • Web
        • 协程
        • Kotlin 中的 Spring 项目
        • 入门指南
        • 资源
      • Apache Groovy
      • 动态语言支持
    • 附录
    • Wiki
Edit this Page GitHub Project Stack Overflow
  • Spring Framework
  • Core Technologies
  • Appendix

附录

章节摘要

  • XML模式
  • XML模式编写
  • 应用程序启动步骤
提前优化 XML模式
  • Spring Framework
    • 6.2.0-SNAPSHOT
    • 6.1.6-SNAPSHOT
    • 6.1.5current
    • 6.0.19-SNAPSHOT
    • 6.0.18
  • Related Spring Documentation
    • Spring Framework
    • Spring Cloud
      • Spring Cloud Build
      • Spring Cloud Bus
      • Spring Cloud Circuit Breaker
      • Spring Cloud Commons
      • Spring Cloud Config
      • Spring Cloud Consul
      • Spring Cloud Contract
      • Spring Cloud Function
      • Spring Cloud Gateway
      • Spring Cloud Kubernetes
      • Spring Cloud Netflix
      • Spring Cloud OpenFeign
      • Spring Cloud Stream
      • Spring Cloud Task
      • Spring Cloud Vault
      • Spring Cloud Zookeeper
    • Spring Data
      • Spring Data Cassandra
      • Spring Data Commons
      • Spring Data Couchbase
      • Spring Data Elasticsearch
      • Spring Data JPA
      • Spring Data KeyValue
      • Spring Data LDAP
      • Spring Data MongoDB
      • Spring Data Neo4j
      • Spring Data Redis
      • Spring Data JDBC & R2DBC
      • Spring Data REST
    • Spring Integration
    • Spring Batch
    • Spring Security
      • Spring Authorization Server
      • Spring LDAP
      • Spring Security Kerberos
      • Spring Session
      • Spring Vault
    • Spring AI
    • Spring CLI
    • Spring GraphQL
    • Spring for Apache Kafka
    • Spring Modulith
    • Spring for Apache Pulsar
    • Spring Shell
  • All Docs...
Spring

© VMware, Inc. or its affiliates. Terms of Use • Privacy • Trademark Guidelines • Thank you • Your California Privacy Rights • Cookie Settings

Apache®, Apache Tomcat®, Apache Kafka®, Apache Cassandra™, and Apache Geode™ are trademarks or registered trademarks of the Apache Software Foundation in the United States and/or other countries. Java™, Java™ SE, Java™ EE, and OpenJDK™ are trademarks of Oracle and/or its affiliates. Kubernetes® is a registered trademark of the Linux Foundation in the United States and other countries. Linux® is the registered trademark of Linus Torvalds in the United States and other countries. Windows® and Microsoft® Azure are registered trademarks of Microsoft Corporation. “AWS” and “Amazon Web Services” are trademarks or registered trademarks of Amazon.com Inc. or its affiliates. All other trademarks and copyrights are property of their respective owners and are only mentioned for informative purposes. Other names may be trademarks of their respective owners.

Search in all Spring Docs