mirror of
https://github.com/spring-projects/spring-framework.git
synced 2026-09-20 20:59:07 +00:00
fixed StandardServlet/PortletEnvironment to check for JNDI (for Google App Engine compatibility)
This commit is contained in:
+5
-1
@@ -24,6 +24,7 @@ import org.springframework.core.env.MutablePropertySources;
|
||||
import org.springframework.core.env.PropertySource;
|
||||
import org.springframework.core.env.PropertySource.StubPropertySource;
|
||||
import org.springframework.core.env.StandardEnvironment;
|
||||
import org.springframework.jndi.JndiLocatorDelegate;
|
||||
import org.springframework.jndi.JndiPropertySource;
|
||||
|
||||
/**
|
||||
@@ -81,7 +82,10 @@ public class StandardServletEnvironment extends StandardEnvironment {
|
||||
protected void customizePropertySources(MutablePropertySources propertySources) {
|
||||
propertySources.addLast(new StubPropertySource(SERVLET_CONFIG_PROPERTY_SOURCE_NAME));
|
||||
propertySources.addLast(new StubPropertySource(SERVLET_CONTEXT_PROPERTY_SOURCE_NAME));
|
||||
propertySources.addLast(new JndiPropertySource(JNDI_PROPERTY_SOURCE_NAME));
|
||||
if (JndiLocatorDelegate.isDefaultJndiEnvironmentAvailable()) {
|
||||
propertySources.addLast(new JndiPropertySource(JNDI_PROPERTY_SOURCE_NAME));
|
||||
}
|
||||
super.customizePropertySources(propertySources);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user