spring-web

org.springframework.web.context.support
Class ServletContextFactoryBean

java.lang.Object
  extended by org.springframework.web.context.support.ServletContextFactoryBean
All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.beans.factory.FactoryBean<javax.servlet.ServletContext>, ServletContextAware

Deprecated. as of Spring 3.0, since "servletContext" is now available as a default bean in every WebApplicationContext

@Deprecated
public class ServletContextFactoryBean
extends java.lang.Object
implements org.springframework.beans.factory.FactoryBean<javax.servlet.ServletContext>, ServletContextAware

FactoryBean that exposes the ServletContext for bean references. Can be used as alternative to implementing the ServletContextAware callback interface. Allows for passing the ServletContext reference to a constructor argument or any custom bean property.

Note that there's a special FactoryBean for exposing a specific ServletContext attribute, named ServletContextAttributeFactoryBean. So if all you need from the ServletContext is access to a specific attribute, ServletContextAttributeFactoryBean allows you to expose a constructor argument or bean property of the attribute type, which is a preferable to a dependency on the full ServletContext.

Since:
1.1.4
Author:
Juergen Hoeller
See Also:
ServletContext, ServletContextAware, ServletContextAttributeFactoryBean, WebApplicationContext.SERVLET_CONTEXT_BEAN_NAME

Constructor Summary
ServletContextFactoryBean()
          Deprecated.  
 
Method Summary
 javax.servlet.ServletContext getObject()
          Deprecated.  
 java.lang.Class<? extends javax.servlet.ServletContext> getObjectType()
          Deprecated.  
 boolean isSingleton()
          Deprecated.  
 void setServletContext(javax.servlet.ServletContext servletContext)
          Deprecated. Set the ServletContext that this object runs in.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServletContextFactoryBean

public ServletContextFactoryBean()
Deprecated. 
Method Detail

setServletContext

public void setServletContext(javax.servlet.ServletContext servletContext)
Deprecated. 
Description copied from interface: ServletContextAware
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.

Specified by:
setServletContext in interface ServletContextAware
Parameters:
servletContext - ServletContext object to be used by this object
See Also:
InitializingBean.afterPropertiesSet(), ApplicationContextAware.setApplicationContext(org.springframework.context.ApplicationContext)

getObject

public javax.servlet.ServletContext getObject()
Deprecated. 
Specified by:
getObject in interface org.springframework.beans.factory.FactoryBean<javax.servlet.ServletContext>

getObjectType

public java.lang.Class<? extends javax.servlet.ServletContext> getObjectType()
Deprecated. 
Specified by:
getObjectType in interface org.springframework.beans.factory.FactoryBean<javax.servlet.ServletContext>

isSingleton

public boolean isSingleton()
Deprecated. 
Specified by:
isSingleton in interface org.springframework.beans.factory.FactoryBean<javax.servlet.ServletContext>

spring-web