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. @author Juergen Hoeller @since 1.1.4 @see javax.servlet.ServletContext#getAttribute @see WebApplicationContextUtils#getWebApplicationContext
|
|