From 8273109c56c7ceeff94a1ad7027148480085efb3 Mon Sep 17 00:00:00 2001 From: "Arend v. Reinersdorff" Date: Thu, 19 May 2022 21:23:38 +0200 Subject: [PATCH] Clarify docs on JNDI properties in Servlet environment --- .../web/context/support/StandardServletEnvironment.java | 4 +++- src/docs/asciidoc/core/core-beans.adoc | 5 ++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/spring-web/src/main/java/org/springframework/web/context/support/StandardServletEnvironment.java b/spring-web/src/main/java/org/springframework/web/context/support/StandardServletEnvironment.java index d30d96035a01..35c29ad0e020 100644 --- a/spring-web/src/main/java/org/springframework/web/context/support/StandardServletEnvironment.java +++ b/spring-web/src/main/java/org/springframework/web/context/support/StandardServletEnvironment.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2021 the original author or authors. + * Copyright 2002-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -95,6 +95,8 @@ protected StandardServletEnvironment(MutablePropertySources propertySources) { * {@link StubPropertySource stubs} at this stage, and will be * {@linkplain #initPropertySources(ServletContext, ServletConfig) fully initialized} * once the actual {@link ServletContext} object becomes available. + *

Addition of {@value #JNDI_PROPERTY_SOURCE_NAME} can be disabled with + * {@link JndiLocatorDelegate#IGNORE_JNDI_PROPERTY_NAME}. * @see StandardEnvironment#customizePropertySources * @see org.springframework.core.env.AbstractEnvironment#customizePropertySources * @see ServletConfigPropertySource diff --git a/src/docs/asciidoc/core/core-beans.adoc b/src/docs/asciidoc/core/core-beans.adoc index a7112f899260..46f892650a45 100644 --- a/src/docs/asciidoc/core/core-beans.adoc +++ b/src/docs/asciidoc/core/core-beans.adoc @@ -9981,9 +9981,8 @@ is configured with two PropertySource objects -- one representing the set of JVM NOTE: These default property sources are present for `StandardEnvironment`, for use in standalone applications. {api-spring-framework}/web/context/support/StandardServletEnvironment.html[`StandardServletEnvironment`] -is populated with additional default property sources including servlet config and servlet -context parameters. It can optionally enable a {api-spring-framework}/jndi/JndiPropertySource.html[`JndiPropertySource`]. -See the javadoc for details. +is populated with additional default property sources: Servlet config, servlet context parameters and a +{api-spring-framework}/jndi/JndiPropertySource.html[`JndiPropertySource`]. Concretely, when you use the `StandardEnvironment`, the call to `env.containsProperty("my-property")` returns true if a `my-property` system property or `my-property` environment variable is present at