Package org.springframework.web.context

# Interface ServletContextAware

All Superinterfaces:
  `org.springframework.beans.factory.Aware`

All Known Implementing Classes:
  `AbstractRequestLoggingFilter`, `CharacterEncodingFilter`, `CommonsRequestLoggingFilter`, `ContentNegotiationManagerFactoryBean`, `CorsFilter`, `DelegatingFilterProxy`, `FormContentFilter`, `ForwardedHeaderFilter`, `GenericFilterBean`, `HiddenHttpMethodFilter`, `MultipartFilter`, `OncePerRequestFilter`, `RelativeRedirectFilter`, `RequestContextFilter`, `ServerHttpObservationFilter`, `ServletContextAttributeExporter`, `ServletContextAttributeFactoryBean`, `ServletContextParameterFactoryBean`, `ServletContextRequestLoggingFilter`, `ShallowEtagHeaderFilter`, `UrlHandlerFilter`, `WebApplicationObjectSupport`

public interface ServletContextAware extends org.springframework.beans.factory.Aware
Interface to be implemented by any object that wishes to be notified of the `ServletContext` (typically determined by the `WebApplicationContext`) that it runs in.

Since:
  12.03.2004
Author:
  Juergen Hoeller, Chris Beams
See Also:
  - `ServletConfigAware`

## Method Summary

Modifier and Type
Method
Description
`void`
`setServletContext(ServletContext servletContext)`
Set the `ServletContext` that this object runs in.

## Method Details

### setServletContext

void setServletContext(ServletContext servletContext)
Set the `ServletContext` that this object runs in.

Invoked 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`.

Parameters:
  `servletContext` - the ServletContext object to be used by this object
See Also:
  - `InitializingBean.afterPropertiesSet()`
  - `ApplicationContextAware.setApplicationContext(org.springframework.context.ApplicationContext)`