Class ServletContextAttributeExporter

java.lang.Object
org.springframework.web.context.support.ServletContextAttributeExporter
All Implemented Interfaces:
Aware, ServletContextAware

public class ServletContextAttributeExporter extends Object implements ServletContextAware
Exporter that takes Spring-defined objects and exposes them as ServletContext attributes. Usually, bean references will be used to export Spring-defined beans as ServletContext attributes.

Useful to make Spring-defined beans available to code that is not aware of Spring 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 Spring application context.

Alternatively, consider using the WebApplicationContextUtils class to access Spring-defined beans via the WebApplicationContext interface. This makes client code aware of Spring API, of course.

Since:
1.1.4
Author:
Juergen Hoeller
See Also:
  • Field Details

    • logger

      protected final Log logger
  • Constructor Details

    • ServletContextAttributeExporter

      public ServletContextAttributeExporter()
  • Method Details