|
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.ServletContextAttributeFactoryBean
public class ServletContextAttributeFactoryBean
FactoryBean that fetches a specific, existing ServletContext attribute.
Exposes that ServletContext attribute when used as bean reference,
effectively making it available as named Spring bean instance.
Intended to link in ServletContext attributes that exist before the startup of the Spring application context. Typically, such attributes will have been put there by third-party web frameworks. In a purely Spring-based web application, no such linking in of ServletContext attributes will be necessary.
NOTE: As of Spring 3.0, you may also use the "contextAttributes" default bean which is of type Map, and dereference it using an "#{contextAttributes.myKey}" expression to access a specific attribute by name.
WebApplicationContext.CONTEXT_ATTRIBUTES_BEAN_NAME,
ServletContextParameterFactoryBean| Constructor Summary | |
|---|---|
ServletContextAttributeFactoryBean()
|
|
| Method Summary | |
|---|---|
java.lang.Object |
getObject()
|
java.lang.Class<?> |
getObjectType()
|
boolean |
isSingleton()
|
void |
setAttributeName(java.lang.String attributeName)
Set the name of the ServletContext attribute 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 ServletContextAttributeFactoryBean()
| Method Detail |
|---|
public void setAttributeName(java.lang.String attributeName)
public void setServletContext(javax.servlet.ServletContext servletContext)
ServletContextAwareInvoked 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 ServletContextAwareservletContext - ServletContext object to be used by this objectInitializingBean.afterPropertiesSet(),
ApplicationContextAware.setApplicationContext(org.springframework.context.ApplicationContext)
public java.lang.Object getObject()
throws java.lang.Exception
getObject in interface org.springframework.beans.factory.FactoryBean<java.lang.Object>java.lang.Exceptionpublic java.lang.Class<?> getObjectType()
getObjectType in interface org.springframework.beans.factory.FactoryBean<java.lang.Object>public boolean isSingleton()
isSingleton in interface org.springframework.beans.factory.FactoryBean<java.lang.Object>
|
spring-web | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||