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

ServletContextPropertyUtils

abstract class ServletContextPropertyUtils

Helper class for resolving placeholders in texts. Usually applied to file paths.

A text may contain ${...} placeholders, to be resolved as servlet context init parameters or system properties: e.g. ${user.dir}. Default values can be supplied using the ":" separator between key and value.

Author
Juergen Hoeller

Author
Marten Deinum

Since
3.2.2

See Also
SystemPropertyUtilsServletContext#getInitParameter(String)

Constructors

<init>

ServletContextPropertyUtils()

Helper class for resolving placeholders in texts. Usually applied to file paths.

A text may contain ${...} placeholders, to be resolved as servlet context init parameters or system properties: e.g. ${user.dir}. Default values can be supplied using the ":" separator between key and value.

Functions

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.

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.