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容器和Beans简介
        • 容器概述
        • Bean概述
        • 依赖
          • 依赖注入
          • 详细的依赖和配置
          • 使用depends-on
          • 延迟初始化的Beans
          • 自动装配协作者
          • 方法注入
        • 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定义中的表达式
        • 语言参考
          • 字面表达式
          • 属性、数组、列表、映射和索引器
          • 内联列表
          • 内联映射
          • 数组构造
          • 方法
          • Operators
          • Types
          • Constructors
          • Variables
          • Functions
          • Bean References
          • Ternary Operator (If-Then-Else)
          • The Elvis Operator
          • Safe Navigation Operator
          • Collection Selection
          • Collection Projection
          • Expression Templating
        • Classes Used in the Examples
      • Aspect Oriented Programming with Spring
        • AOP Concepts
        • Spring AOP Capabilities and Goals
        • AOP Proxies
        • @AspectJ support
          • Enabling @AspectJ Support
          • Declaring an Aspect
          • Declaring a Pointcut
          • Declaring Advice
          • Introductions
          • Aspect Instantiation Models
          • An AOP Example
        • Schema-based AOP Support
        • Choosing which AOP Declaration Style to Use
        • Mixing Aspect Types
        • Proxying Mechanisms
        • Programmatic Creation of @AspectJ Proxies
        • Using AspectJ with Spring Applications
        • Further Resources
      • Spring AOP APIs
        • Pointcut API in Spring
        • Advice API in Spring
        • The Advisor API in Spring
        • Using the ProxyFactoryBean to Create AOP Proxies
        • Concise Proxy Definitions
        • Creating AOP Proxies Programmatically with the ProxyFactory
        • Manipulating Advised Objects
        • Using the "auto-proxy" facility
        • Using TargetSource Implementations
        • Defining New Advice Types
      • Null-safety
      • Data Buffers and Codecs
      • Logging
      • Ahead of Time Optimizations
      • Appendix
        • XML Schemas
        • XML Schema Authoring
        • Application Startup Steps
    • Testing
      • Introduction to Spring Testing
      • Unit Testing
      • Integration Testing
      • JDBC Testing Support
      • Spring TestContext Framework
        • Key Abstractions
        • Bootstrapping the TestContext Framework
        • TestExecutionListener Configuration
        • Application Events
        • Test Execution Events
        • Context Management
          • Context Configuration with XML resources
          • 使用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 测试注解
          • Spring JUnit Jupiter 测试注解
          • 测试的元注解支持
        • 更多资源
    • 数据访问
      • 事务管理
        • Spring框架事务支持模型的优势
        • 理解Spring框架事务抽象
        • 与事务同步资源
        • 声明式事务管理
          • 理解Spring框架的声明式事务实现
          • 声明式事务实现示例
          • 回滚声明式事务
          • 为不同的Bean配置不同的事务语义
          • <tx:advice/>设置
          • 使用@Transactional
          • 事务传播
          • 为事务操作提供建议
          • 使用AspectJ的@Transactional
        • 编程式事务管理
        • 选择编程式和声明式事务管理之间
        • 与事务绑定的事件
        • 应用服务器特定的集成
        • 常见问题的解决方案
        • 更多资源
      • DAO支持
      • JDBC数据访问
        • 选择JDBC数据库访问的方法
        • 包层次结构
        • 使用JDBC核心类控制基本JDBC处理和错误处理
        • 控制数据库连接
        • JDBC批处理操作
        • 使用SimpleJdbc类简化JDBC操作
        • 将JDBC操作建模为Java对象
        • 参数和数据值处理的常见问题
        • 嵌入式数据库支持
        • Initializing a DataSource
      • Data Access with R2DBC
      • Object Relational Mapping (ORM) Data Access
        • Introduction to ORM with Spring
        • General ORM Integration Considerations
        • Hibernate
        • JPA
      • Marshalling XML by Using Object-XML Mappers
      • Appendix
    • Web on Servlet Stack
      • Spring Web MVC
        • DispatcherServlet
          • Context Hierarchy
          • Special Bean Types
          • Web MVC Config
          • Servlet Config
          • Processing
          • Path Matching
          • Interception
          • Exceptions
          • View Resolution
          • Locale
          • Themes
          • Multipart Resolver
          • Logging
        • Filters
        • Annotated Controllers
          • Declaration
          • Mapping Requests
          • Handler Methods
            • Method Arguments
            • Return Values
            • Type Conversion
            • Matrix Variables
            • @RequestParam
            • @RequestHeader
            • @CookieValue
            • @ModelAttribute
            • @SessionAttributes
            • @SessionAttribute
            • @RequestAttribute
            • Redirect Attributes
            • Flash Attributes
            • Multipart
            • @RequestBody
            • HttpEntity
            • @ResponseBody
            • ResponseEntity
            • Jackson JSON
          • Model
          • @InitBinder
          • Validation
          • Exceptions
          • Controller Advice
        • Functional Endpoints
        • URI Links
        • Asynchronous Requests
        • CORS
        • Error Responses
        • Web Security
        • HTTP Caching
        • View Technologies
          • Thymeleaf
          • FreeMarker
          • Groovy Markup
          • 脚本视图
          • JSP和JSTL
          • RSS和Atom
          • PDF和Excel
          • Jackson
          • XML编组
          • XSLT视图
        • MVC配置
          • 启用MVC配置
          • MVC配置API
          • 类型转换
          • 验证
          • 拦截器
          • 内容类型
          • 消息转换器
          • 视图控制器
          • 视图解析器
          • 静态资源
          • 默认Servlet
          • 路径匹配
          • 高级Java配置
          • 高级XML配置
        • HTTP/2
      • REST客户端
      • 测试
      • WebSockets
        • WebSocket API
        • SockJS回退
        • STOMP
          • 概述
          • 优势
          • 启用STOMP
          • WebSocket传输
          • 消息流
          • 注解控制器
          • 发送消息
          • 简单代理
          • 外部代理
          • 连接到代理
          • 点作为分隔符
          • 认证
          • 令牌认证
          • 授权
          • 用户目标
          • 消息顺序
          • 事件
          • 拦截
          • STOMP客户端
          • WebSocket范围
          • 性能
          • 监控
          • 测试
      • 其他Web框架
    • 响应式堆栈上的Web
      • Spring WebFlux
        • 概述
        • 响应式核心
        • DispatcherHandler
        • 注解控制器
          • @Controller
          • 映射请求
          • 处理方法
            • 方法参数
            • 返回值
            • 类型转换
            • 矩阵变量
            • @RequestParam
            • @RequestHeader
            • @CookieValue
            • @ModelAttribute
            • @SessionAttributes
            • @SessionAttribute
            • @RequestAttribute
            • 多部分内容
            • @RequestBody
            • HttpEntity
            • @ResponseBody
            • ResponseEntity
            • Jackson JSON
          • Model
          • DataBinder
          • 验证
          • 异常
          • 控制器建议
        • 功能端点
        • URI链接
        • 跨域资源共享
        • 错误响应
        • Web安全
        • HTTP缓存
        • 视图技术
        • WebFlux配置
        • HTTP/2
      • WebClient
        • 配置
        • retrieve()
        • 交换
        • 请求体
        • 过滤器
        • 属性
        • 上下文
        • 同步使用
        • 测试
      • HTTP接口客户端
      • WebSockets
      • 测试
      • RSocket
      • 响应式库
    • 集成
      • REST客户端
      • JMS(Java消息服务)
        • 使用Spring JMS
        • 发送消息
        • 接收消息
        • 支持JCA消息端点
        • 基于注解的监听器端点
        • JMS命名空间支持
      • JMX
        • 将您的Bean导出到JMX
        • 控制Bean的管理接口
        • 控制您的Bean的ObjectName实例
        • 使用JSR-160连接器
        • 通过代理访问MBeans
        • 通知
        • 更多资源
      • 电子邮件
      • 任务执行和调度
      • 缓存抽象
        • 理解缓存抽象
        • 声明式基于注解的缓存
        • JCache(JSR-107)注解
        • 声明式基于XML的缓存
        • 配置缓存存储
        • Plugging-in Different Back-end Caches
        • How can I Set the TTL/TTI/Eviction policy/XXX feature?
      • Observability Support
      • JVM Checkpoint Restore
      • CDS
      • Appendix
    • Language Support
      • Kotlin
        • Requirements
        • Extensions
        • Null-safety
        • Classes and Interfaces
        • Annotations
        • Bean Definition DSL
        • Web
        • Coroutines
        • Spring Projects in Kotlin
        • Getting Started
        • Resources
      • Apache Groovy
      • Dynamic Language Support
    • Appendix
    • Wiki

Spring Projects

  • 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
  • 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