对于最新的稳定版本,请使用 Spring Framework 6.2.10spring-doc.cadn.net.cn

附录

参考文档的这一部分涵盖了适用于多个模块的主题在核心 Spring 框架中。spring-doc.cadn.net.cn

弹簧属性

SpringProperties是一个静态持有者用于控制 Spring Framework 的某些低级方面的属性。用户可以通过 JVM 系统属性或通过SpringProperties.setProperty(String key, String value)方法。 后者可能是如果部署环境不允许自定义 JVM 系统属性,则是必要的。作为替代方案,这些属性可以在spring.properties文件在根类路径中——例如,部署在应用程序的 JAR 文件中。spring-doc.cadn.net.cn

下表列出了当前支持的所有 Spring 属性。spring-doc.cadn.net.cn

表 1.支持的弹簧属性
名称 描述

spring.aop.ajc.ignorespring-doc.cadn.net.cn

指示 Spring 忽略 ajc 编译的 aspect 以进行 Spring AOP 代理,恢复传统的同时启用 weaving 和 AspectJ 自动代理的场景的 Spring 行为。 看AbstractAspectJAdvisorFactory了解详情。spring-doc.cadn.net.cn

spring.aot.enabledspring-doc.cadn.net.cn

指示应用程序应使用 AOT 生成的项目运行。请参阅提前优化AotDetector了解详情。spring-doc.cadn.net.cn

spring.beaninfo.ignorespring-doc.cadn.net.cn

指示 Spring 使用Introspector.IGNORE_ALL_BEANINFO调用JavaBeans 时的模式Introspector. 看StandardBeanInfoFactory了解详情。spring-doc.cadn.net.cn

spring.cache.reactivestreams.ignorespring-doc.cadn.net.cn

指示 Spring 的缓存基础设施忽略响应式流的存在,特别是 Reactor 的Mono/Flux@Cacheable方法返回类型声明。 看CacheAspectSupport了解详情。spring-doc.cadn.net.cn

spring.classformat.ignorespring-doc.cadn.net.cn

指示 Spring 在类路径扫描期间忽略类格式异常,在特别是对于不受支持的类文件版本。 看ClassPathScanningCandidateComponentProvider了解详情。spring-doc.cadn.net.cn

spring.context.checkpointspring-doc.cadn.net.cn

指定公共上下文检查点的属性。请参阅启动时的自动检查点/恢复和DefaultLifecycleProcessor了解详情。spring-doc.cadn.net.cn

spring.context.exitspring-doc.cadn.net.cn

用于在上下文到达特定阶段时终止 JVM 的属性。请参阅启动时的自动检查点/恢复DefaultLifecycleProcessor了解详情。spring-doc.cadn.net.cn

spring.context.expression.maxLengthspring-doc.cadn.net.cn

XML Bean 定义中使用的 Spring Expression Language 表达式的最大长度,@Value等。spring-doc.cadn.net.cn

spring.expression.compiler.modespring-doc.cadn.net.cn

编译 Spring 表达式语言的表达式时使用的模式。spring-doc.cadn.net.cn

spring.getenv.ignorespring-doc.cadn.net.cn

指示 Spring 忽略作系统环境变量,如果 SpringEnvironment属性 — 例如,配置中的占位符 字符串 — 不是否则可解析。 看AbstractEnvironment了解详情。spring-doc.cadn.net.cn

spring.jdbc.getParameterType.ignorespring-doc.cadn.net.cn

指示 Spring 忽略java.sql.ParameterMetaData.getParameterType完全。 请参阅使用对象列表进行批处理作中的注释。spring-doc.cadn.net.cn

spring.jndi.ignorespring-doc.cadn.net.cn

指示 Spring 忽略默认的 JNDI 环境,作为场景的优化 从一开始就找不到此类 JNDI 回退搜索,避免 重复的 JNDI 查找开销。看JndiLocatorDelegate了解详情。spring-doc.cadn.net.cn

spring.objenesis.ignorespring-doc.cadn.net.cn

指示 Spring 忽略 Objenesis,甚至不尝试使用它。看SpringObjenesis了解详情。spring-doc.cadn.net.cn

spring.test.aot.processing.failOnErrorspring-doc.cadn.net.cn

一个布尔标志,用于控制在 Spring TestContext 框架中的 AOT 处理期间遇到的错误是否应导致整个进程失败的异常。 请参阅测试的提前支持spring-doc.cadn.net.cn

spring.test.constructor.autowire.modespring-doc.cadn.net.cn

如果@TestConstructor不存在 在测试类上。请参阅更改默认测试构造函数自动连线模式spring-doc.cadn.net.cn

spring.test.context.cache.maxSizespring-doc.cadn.net.cn

Spring TestContext 框架中上下文缓存的最大大小。请参阅上下文缓存spring-doc.cadn.net.cn

spring.test.context.failure.thresholdspring-doc.cadn.net.cn

尝试加载ApplicationContextSpring TestContext 框架中。请参阅上下文故障阈值spring-doc.cadn.net.cn

spring.test.enclosing.configurationspring-doc.cadn.net.cn

如果@NestedTestConfiguration不存在于测试类中。请参阅更改默认封闭配置继承模式spring-doc.cadn.net.cn