类 ServletContextAttributeFactoryBean
java.lang.Object
cn.taketoday.web.servlet.support.ServletContextAttributeFactoryBean
- 所有已实现的接口:
cn.taketoday.beans.factory.Aware,cn.taketoday.beans.factory.FactoryBean<Object>,ServletContextAware
public class ServletContextAttributeFactoryBean
extends Object
implements cn.taketoday.beans.factory.FactoryBean<Object>, ServletContextAware
FactoryBean that fetches a specific, existing ServletContext attribute.
Exposes that ServletContext attribute when used as bean reference,
effectively making it available as named Framework bean instance.
Intended to link in ServletContext attributes that exist before the startup of the Framework application context. Typically, such attributes will have been put there by third-party web frameworks. In a purely Framework-based web application, no such linking in of ServletContext attributes will be necessary.
NOTE: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.
- 从以下版本开始:
- 4.0
- 作者:
- Juergen Hoeller
- 另请参阅:
-
字段概要
字段从接口继承的字段 cn.taketoday.beans.factory.FactoryBean
OBJECT_TYPE_ATTRIBUTE -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明Class<?>booleanvoidsetAttributeName(String attributeName) Set the name of the ServletContext attribute to expose.voidsetServletContext(ServletContext servletContext) Set theServletContextthat this object runs in.
-
字段详细资料
-
attributeName
-
attribute
-
-
构造器详细资料
-
ServletContextAttributeFactoryBean
public ServletContextAttributeFactoryBean()
-
-
方法详细资料
-
setAttributeName
Set the name of the ServletContext attribute to expose. -
setServletContext
从接口复制的说明:ServletContextAwareSet theServletContextthat this object runs in.Invoked after population of normal bean properties but before an init callback like InitializingBean's
afterPropertiesSetor a custom init-method. Invoked after ApplicationContextAware'ssetApplicationContext.- 指定者:
setServletContext在接口中ServletContextAware- 参数:
servletContext- the ServletContext object to be used by this object- 另请参阅:
-
InitializingBean.afterPropertiesSet()ApplicationContextAware.setApplicationContext(cn.taketoday.context.ApplicationContext)
-
getObject
-
getObjectType
- 指定者:
getObjectType在接口中cn.taketoday.beans.factory.FactoryBean<Object>
-
isSingleton
public boolean isSingleton()- 指定者:
isSingleton在接口中cn.taketoday.beans.factory.FactoryBean<Object>
-