spring-framework / org.springframework.web.context.support / WebApplicationContextUtils / initServletPropertySources

initServletPropertySources

open static fun initServletPropertySources(propertySources: MutablePropertySources, servletContext: ServletContext): Unit

Convenient variant of #initServletPropertySources(MutablePropertySources, * ServletContext, ServletConfig) that always provides null for the ServletConfig parameter.

See Also
#initServletPropertySources(MutablePropertySources, ServletContext, ServletConfig)

open static fun initServletPropertySources(sources: MutablePropertySources, @Nullable servletContext: ServletContext, @Nullable servletConfig: ServletConfig): Unit

Replace Servlet-based StubPropertySource with actual instances populated with the given servletContext and servletConfig objects.

This method is idempotent with respect to the fact it may be called any number of times but will perform replacement of stub property sources with their corresponding actual property sources once and only once.

Parameters

sources - the MutablePropertySources to initialize (must not be null)

servletContext - the current ServletContext (ignored if null or if the servlet context property source has already been initialized)

servletConfig - the current ServletConfig (ignored if null or if the servlet config property source has already been initialized)

See Also
org.springframework.core.env.PropertySource.StubPropertySourceorg.springframework.core.env.ConfigurableEnvironment#getPropertySources()