类 ServletContextAttributeExporter
- 所有已实现的接口:
cn.taketoday.beans.factory.Aware,ServletContextAware
Useful to make Frameworkdefined beans available to code that is not aware of Framework at all, but rather just of the Servlet API. Client code can then use plain ServletContext attribute lookups to access those objects, despite them being defined in a Framework application context.
Alternatively, consider using the WebApplicationContextUtils class to access Framework-defined beans via the WebServletApplicationContext interface. This makes client code aware of Framework API, of course.
- 从以下版本开始:
- 4.0
- 作者:
- Juergen Hoeller
- 另请参阅:
-
字段概要
字段修饰符和类型字段说明protected final cn.taketoday.logging.Logger -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明voidsetAttributes(Map<String, Object> attributes) Set the ServletContext attributes to expose as key-value pairs.voidsetServletContext(ServletContext servletContext) Set theServletContextthat this object runs in.
-
字段详细资料
-
logger
protected final cn.taketoday.logging.Logger logger -
attributes
-
-
构造器详细资料
-
ServletContextAttributeExporter
public ServletContextAttributeExporter()
-
-
方法详细资料
-
setAttributes
Set the ServletContext attributes to expose as key-value pairs. Each key will be considered a ServletContext attributes key, and each value will be used as corresponding attribute value.Usually, you will use bean references for the values, to export Frameworkdefined beans as ServletContext attributes. Of course, it is also possible to define plain values to export.
-
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)
-