|
spring-web | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.web.context.support.ServletContextParameterFactoryBean
public class 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.
WebApplicationContext.CONTEXT_PARAMETERS_BEAN_NAME
,
ServletContextAttributeFactoryBean
Constructor Summary | |
---|---|
ServletContextParameterFactoryBean()
|
Method Summary | |
---|---|
java.lang.String |
getObject()
|
java.lang.Class<java.lang.String> |
getObjectType()
|
boolean |
isSingleton()
|
void |
setInitParamName(java.lang.String initParamName)
Set the name of the ServletContext init parameter to expose. |
void |
setServletContext(javax.servlet.ServletContext servletContext)
Set the ServletContext that this object runs in. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ServletContextParameterFactoryBean()
Method Detail |
---|
public void setInitParamName(java.lang.String initParamName)
public void setServletContext(javax.servlet.ServletContext servletContext)
ServletContextAware
Invoked after population of normal bean properties but before an init
callback like InitializingBean's afterPropertiesSet
or a
custom init-method. Invoked after ApplicationContextAware's
setApplicationContext
.
setServletContext
in interface ServletContextAware
servletContext
- ServletContext object to be used by this objectInitializingBean.afterPropertiesSet()
,
ApplicationContextAware.setApplicationContext(org.springframework.context.ApplicationContext)
public java.lang.String getObject()
getObject
in interface org.springframework.beans.factory.FactoryBean<java.lang.String>
public java.lang.Class<java.lang.String> getObjectType()
getObjectType
in interface org.springframework.beans.factory.FactoryBean<java.lang.String>
public boolean isSingleton()
isSingleton
in interface org.springframework.beans.factory.FactoryBean<java.lang.String>
|
spring-web | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |