spring-framework / org.springframework.web.context.support / ServletContextParameterFactoryBean

ServletContextParameterFactoryBean

open class ServletContextParameterFactoryBean : FactoryBean<String>, ServletContextAware

FactoryBean that retrieves a specific ServletContext init parameter (that is, a "context-param" defined in web.xml). Exposes that ServletContext init parameter when used as bean reference, effectively making it available as named Spring bean instance.

NOTE: As of Spring 3.0, you may also use the "contextParameters" default bean which is of type Map, and dereference it using an "#{contextParameters.myKey}" expression to access a specific parameter by name.

Author
Juergen Hoeller

Since
1.2.4

See Also
org.springframework.web.context.WebApplicationContext#CONTEXT_PARAMETERS_BEAN_NAMEServletContextAttributeFactoryBean

Constructors

<init>

ServletContextParameterFactoryBean()

FactoryBean that retrieves a specific ServletContext init parameter (that is, a "context-param" defined in web.xml). Exposes that ServletContext init parameter when used as bean reference, effectively making it available as named Spring bean instance.

NOTE: As of Spring 3.0, you may also use the "contextParameters" default bean which is of type Map, and dereference it using an "#{contextParameters.myKey}" expression to access a specific parameter by name.

Functions

getObject

open fun getObject(): String

getObjectType

open fun getObjectType(): Class<String>

isSingleton

open fun isSingleton(): Boolean

setInitParamName

open fun setInitParamName(initParamName: String): Unit

Set the name of the ServletContext init parameter to expose.

setServletContext

open fun setServletContext(servletContext: ServletContext): Unit