Spring
Spring Framework 中文文档
    • Overview
    • Core Technologies
      • The IoC Container
        • Introduction to the Spring IoC Container and Beans
        • Container Overview
        • Bean Overview
        • Dependencies
          • Dependency Injection
          • Dependencies and Configuration in Detail
          • Using depends-on
          • Lazy-initialized Beans
          • Autowiring Collaborators
          • Method Injection
        • Bean Scopes
        • Customizing the Nature of a Bean
        • Bean Definition Inheritance
        • Container Extension Points
        • Annotation-based Container Configuration
          • Using @Autowired
          • Fine-tuning Annotation-based Autowiring with @Primary or @Fallback
          • Fine-tuning Annotation-based Autowiring with Qualifiers
          • Using Generics as Autowiring Qualifiers
          • Using CustomAutowireConfigurer
          • Injection with @Resource
          • Using @Value
          • Using @PostConstruct and @PreDestroy
        • Classpath Scanning and Managed Components
        • Using JSR 330 Standard Annotations
        • Java-based Container Configuration
          • Basic Concepts: @Bean and @Configuration
          • Instantiating the Spring Container by Using AnnotationConfigApplicationContext
          • Using the @Bean Annotation
          • Using the @Configuration annotation
          • Composing Java-based Configurations
        • Environment Abstraction
        • Registering a LoadTimeWeaver
        • Additional Capabilities of the ApplicationContext
        • The BeanFactory API
      • Resources
      • Validation, Data Binding, and Type Conversion
        • Validation by Using Spring’s Validator Interface
        • Data Binding
        • Resolving Codes to Error Messages
        • Spring Type Conversion
        • Spring Field Formatting
        • Configuring a Global Date and Time Format
        • Java Bean Validation
      • Spring Expression Language (SpEL)
        • Evaluation
        • Expressions in Bean Definitions
        • Language Reference
          • Literal Expressions
          • Properties, Arrays, Lists, Maps, and Indexers
          • Inline Lists
          • Inline Maps
          • Array Construction
          • Methods
          • 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
    • 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
      • 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
        • HTTP Message Conversion
        • 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
          • 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
    • 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
          • Context Configuration with Groovy Scripts
          • Context Configuration with Component Classes
          • Mixing XML, Groovy Scripts, and Component Classes
          • Configuration Configuration with Context Customizers
          • Context Configuration with Context Initializers
          • Context Configuration Inheritance
          • Context Configuration with Environment Profiles
          • Context Configuration with Test Property Sources
          • Context Configuration with Dynamic Property Sources
          • Loading a WebApplicationContext
          • Working with Web Mocks
          • Context Caching
          • Context Failure Threshold
          • Context Hierarchies
        • Dependency Injection of Test Fixtures
        • Bean Overriding in Tests
        • Testing Request- and Session-scoped Beans
        • Transaction Management
        • Executing SQL Scripts
        • Parallel Test Execution
        • TestContext Framework Support Classes
        • Ahead of Time Support for Tests
      • WebTestClient
      • MockMvc
        • Overview
        • Setup Options
        • Hamcrest Integration
          • Static Imports
          • Configuring MockMvc
          • Setup Features
          • Performing Requests
          • Defining Expectations
          • Async Requests
          • Streaming Responses
          • Filter Registrations
        • AssertJ Integration
          • Configuring MockMvcTester
          • Performing Requests
          • Defining Expectations
          • MockMvc integration
        • HtmlUnit Integration
          • Why HtmlUnit Integration?
          • MockMvc and HtmlUnit
          • MockMvc and WebDriver
          • MockMvc and Geb
        • MockMvc vs End-to-End Tests
        • Further Examples
      • Testing Client Applications
      • Appendix
        • Annotations
          • Standard Annotation Support
          • Spring Testing Annotations
            • @BootstrapWith
            • @ContextConfiguration
            • @WebAppConfiguration
            • @ContextHierarchy
            • @ContextCustomizerFactories
            • @ActiveProfiles
            • @TestPropertySource
            • @DynamicPropertySource
            • @TestBean
            • @MockitoBean and @MockitoSpyBean
            • @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
    • 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
      • Cache Abstraction
        • Understanding the Cache Abstraction
        • Declarative Annotation-based Caching
        • JCache (JSR-107) Annotations
        • Declarative XML-based Caching
        • Configuring the Cache Storage
        • 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 Framework 中文文档
  • Core Technologies
  • The IoC Container
  • Java-based Container Configuration

Java-based Container Configuration

本部分介绍如何在 Java 代码中使用注解来配置 Spring 容器。

This section covers how to use annotations in your Java code to configure the Spring container.

  • Spring Ai 中文文档
    • defaultcurrent
  • Spring Amqp 中文文档
    • defaultcurrent
  • Spring Authorization-server 中文文档
    • defaultcurrent
  • Spring Batch 中文文档
    • defaultcurrent
  • Spring Boot 中文文档
    • defaultcurrent
  • Spring Cli 中文文档
    • defaultcurrent
  • Spring Cloud Build 中文文档
    • defaultcurrent
  • Spring Cloud Bus 中文文档
    • defaultcurrent
  • Spring Cloud Circuitbreaker 中文文档
    • defaultcurrent
  • Spring Cloud Commons 中文文档
    • defaultcurrent
  • Spring Cloud Config 中文文档
    • defaultcurrent
  • Spring Cloud Consul 中文文档
    • defaultcurrent
  • Spring Cloud Contract 中文文档
    • defaultcurrent
  • Spring Cloud Function 中文文档
    • defaultcurrent
  • Spring Cloud Gateway 中文文档
    • defaultcurrent
  • Spring Cloud Kubernetes 中文文档
    • defaultcurrent
  • Spring Cloud Netflix 中文文档
    • defaultcurrent
  • Spring Cloud Openfeign 中文文档
    • defaultcurrent
  • Spring Cloud Stream 中文文档
    • defaultcurrent
  • Spring Cloud Task 中文文档
    • defaultcurrent
  • Spring Cloud Vault 中文文档
    • defaultcurrent
  • Spring Cloud Zookeeper 中文文档
    • defaultcurrent
  • Spring Data Cassandra 中文文档
    • defaultcurrent
  • Spring Data Commons 中文文档
    • defaultcurrent
  • Spring Data Couchbase 中文文档
    • defaultcurrent
  • Spring Data Elasticsearch 中文文档
    • defaultcurrent
  • Spring Data Jpa 中文文档
    • defaultcurrent
  • Spring Data Keyvalue 中文文档
    • defaultcurrent
  • Spring Data Ldap 中文文档
    • defaultcurrent
  • Spring Data Mongodb 中文文档
    • defaultcurrent
  • Spring Data Neo4j 中文文档
    • defaultcurrent
  • Spring Data Redis 中文文档
    • defaultcurrent
  • Spring Data Relational 中文文档
    • defaultcurrent
  • Spring data Rest 中文文档
    • defaultcurrent
  • Spring Framework 中文文档
    • defaultcurrent
  • Spring Graphql 中文文档
    • defaultcurrent
  • Spring Integration 中文文档
    • defaultcurrent
  • Spring Kafka 中文文档
    • defaultcurrent
  • Spring Ldap 中文文档
    • defaultcurrent
  • Spring Modulith 中文文档
    • defaultcurrent
  • Spring Pulsar 中文文档
    • defaultcurrent
  • Spring Security 中文文档
    • defaultcurrent
  • Spring Session 中文文档
    • defaultcurrent
  • Spring Shell 中文文档
    • defaultcurrent
  • Spring Vault 中文文档
    • defaultcurrent

粤ICP备2024239452号-1