| org.springframework.beans.factory.config.PropertyPlaceholderConfigurer org.springframework.web.context.support.ServletContextPropertyPlaceholderConfigurer
Method Summary | |
protected String | resolvePlaceholder(String placeholder, Properties props) | protected String | resolvePlaceholder(String placeholder, ServletContext servletContext, boolean searchContextAttributes) Resolves the given placeholder using the init parameters
and optionally also the attributes of the given ServletContext.
Default implementation checks ServletContext attributes before
init parameters. | public void | setContextOverride(boolean contextOverride) Set whether ServletContext init parameters (and optionally also ServletContext
attributes) should override local properties within the application. | public void | setSearchContextAttributes(boolean searchContextAttributes) Set whether to search for matching a ServletContext attribute before
checking a ServletContext init parameter. | public void | setServletContext(ServletContext servletContext) Set the ServletContext to resolve placeholders against. |
resolvePlaceholder | protected String resolvePlaceholder(String placeholder, ServletContext servletContext, boolean searchContextAttributes)(Code) | | Resolves the given placeholder using the init parameters
and optionally also the attributes of the given ServletContext.
Default implementation checks ServletContext attributes before
init parameters. Can be overridden to customize this behavior,
potentially also applying specific naming patterns for parameters
and/or attributes (instead of using the exact placeholder name).
Parameters: placeholder - the placeholder to resolve Parameters: servletContext - the ServletContext to check Parameters: searchContextAttributes - whether to search for a matchingServletContext attribute the resolved value, of null if none See Also: javax.servlet.ServletContext.getInitParameter(String) See Also: javax.servlet.ServletContext.getAttribute(String) |
setSearchContextAttributes | public void setSearchContextAttributes(boolean searchContextAttributes)(Code) | | Set whether to search for matching a ServletContext attribute before
checking a ServletContext init parameter. Default is "false": only
checking init parameters.
If turned on, the configurer will look for a ServletContext attribute with
the same name as the placeholder, and use its stringified value if found.
Exposure of such ServletContext attributes can be used to dynamically override
init parameters defined in web.xml , for example in a custom
context listener.
See Also: javax.servlet.ServletContext.getInitParameter(String) See Also: javax.servlet.ServletContext.getAttribute(String) |
setServletContext | public void setServletContext(ServletContext servletContext)(Code) | | Set the ServletContext to resolve placeholders against.
Will be auto-populated when running in a WebApplicationContext.
If not set, this configurer will simply not resolve placeholders
against the ServletContext: It will effectively behave like a plain
PropertyPlaceholderConfigurer in such a scenario.
|
|
|