spring-framework / org.springframework.web.util / ServletContextPropertyUtils / resolvePlaceholders

resolvePlaceholders

open static fun resolvePlaceholders(text: String, servletContext: ServletContext): String

Resolve ${...} placeholders in the given text, replacing them with corresponding servlet context init parameter or system property values.

Parameters

text - the String to resolve

servletContext - the servletContext to use for lookups.

Exceptions

IllegalArgumentException - if there is an unresolvable placeholder

Return
the resolved String

See Also
SystemPropertyUtils#PLACEHOLDER_PREFIXSystemPropertyUtils#PLACEHOLDER_SUFFIXSystemPropertyUtils#resolvePlaceholders(String, boolean)

open static fun resolvePlaceholders(text: String, servletContext: ServletContext, ignoreUnresolvablePlaceholders: Boolean): String

Resolve ${...} placeholders in the given text, replacing them with corresponding servlet context init parameter or system property values. Unresolvable placeholders with no default value are ignored and passed through unchanged if the flag is set to true.

Parameters

text - the String to resolve

servletContext - the servletContext to use for lookups.

ignoreUnresolvablePlaceholders - flag to determine is unresolved placeholders are ignored

Exceptions

IllegalArgumentException - if there is an unresolvable placeholder and the flag is false

Return
the resolved String

See Also
SystemPropertyUtils#PLACEHOLDER_PREFIXSystemPropertyUtils#PLACEHOLDER_SUFFIXSystemPropertyUtils#resolvePlaceholders(String, boolean)