org.apache.myfaces.webapp
Class AbstractFacesInitializer

java.lang.Object
  extended by org.apache.myfaces.webapp.AbstractFacesInitializer
All Implemented Interfaces:
FacesInitializer
Direct Known Subclasses:
FaceletsInitilializer, Jsp20FacesInitializer, Jsp21FacesInitializer

public abstract class AbstractFacesInitializer
extends Object
implements FacesInitializer

Performs common initialization tasks.


Field Summary
protected static String EXPRESSION_FACTORY
          This parameter specifies the ExpressionFactory implementation to use.
static String INIT_PARAM_LOG_WEB_CONTEXT_PARAMS
          Indicate if log all web config params should be done before initialize the webapp.
static String INIT_PARAM_LOG_WEB_CONTEXT_PARAMS_DEFAULT
           
protected static String INITIALIZE_ALWAYS_STANDALONE
          If this param is set to true, the check for faces servlet mapping is not done
 
Constructor Summary
AbstractFacesInitializer()
           
 
Method Summary
protected  RuntimeConfig buildConfiguration(javax.servlet.ServletContext servletContext, ExternalContext externalContext, javax.el.ExpressionFactory expressionFactory)
          Configures this JSF application.
 void destroyFaces(javax.servlet.ServletContext servletContext)
          Cleans up all remaining resources (well, theoretically).
 void destroyShutdownFacesContext(FacesContext facesContext)
           
 void destroyStartupFacesContext(FacesContext facesContext)
           
protected static javax.el.ExpressionFactory getUserDefinedExpressionFactory(ExternalContext externalContext)
          Try to load user-definied ExpressionFactory.
protected abstract  void initContainerIntegration(javax.servlet.ServletContext servletContext, ExternalContext externalContext)
          Performs initialization tasks depending on the current environment.
 void initFaces(javax.servlet.ServletContext servletContext)
          Performs all necessary initialization tasks like configuring this JSF application.
 FacesContext initShutdownFacesContext(javax.servlet.ServletContext servletContext)
           
 FacesContext initStartupFacesContext(javax.servlet.ServletContext servletContext)
           
protected static javax.el.ExpressionFactory loadExpressionFactory(String expressionFactoryClassName)
          Loads and instantiates the given ExpressionFactory implementation.
protected  void validateFacesConfig(javax.servlet.ServletContext servletContext, ExternalContext externalContext)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EXPRESSION_FACTORY

@JSFWebConfigParam(since="1.2.7",
                   group="EL")
protected static final String EXPRESSION_FACTORY
This parameter specifies the ExpressionFactory implementation to use.

See Also:
Constant Field Values

INITIALIZE_ALWAYS_STANDALONE

@JSFWebConfigParam(since="2.0.3",
                   defaultValue="false")
protected static final String INITIALIZE_ALWAYS_STANDALONE
If this param is set to true, the check for faces servlet mapping is not done

See Also:
Constant Field Values

INIT_PARAM_LOG_WEB_CONTEXT_PARAMS

@JSFWebConfigParam(expectedValues="true, auto, false",
                   defaultValue="auto")
public static final String INIT_PARAM_LOG_WEB_CONTEXT_PARAMS
Indicate if log all web config params should be done before initialize the webapp.

If is set in "auto" mode, web config params are only logged on "Development" and "Production" project stages.

See Also:
Constant Field Values

INIT_PARAM_LOG_WEB_CONTEXT_PARAMS_DEFAULT

public static final String INIT_PARAM_LOG_WEB_CONTEXT_PARAMS_DEFAULT
See Also:
Constant Field Values
Constructor Detail

AbstractFacesInitializer

public AbstractFacesInitializer()
Method Detail

initFaces

public void initFaces(javax.servlet.ServletContext servletContext)
Performs all necessary initialization tasks like configuring this JSF application.

Specified by:
initFaces in interface FacesInitializer

destroyFaces

public void destroyFaces(javax.servlet.ServletContext servletContext)
Cleans up all remaining resources (well, theoretically).

Specified by:
destroyFaces in interface FacesInitializer

buildConfiguration

protected RuntimeConfig buildConfiguration(javax.servlet.ServletContext servletContext,
                                           ExternalContext externalContext,
                                           javax.el.ExpressionFactory expressionFactory)
Configures this JSF application. It's required that every FacesInitializer (i.e. every subclass) calls this method during initialization.

Parameters:
servletContext - the current ServletContext
externalContext - the current ExternalContext
expressionFactory - the ExpressionFactory to use
Returns:
the current runtime configuration

validateFacesConfig

protected void validateFacesConfig(javax.servlet.ServletContext servletContext,
                                   ExternalContext externalContext)

getUserDefinedExpressionFactory

protected static javax.el.ExpressionFactory getUserDefinedExpressionFactory(ExternalContext externalContext)
Try to load user-definied ExpressionFactory. Returns null, if no custom ExpressionFactory was specified.

Parameters:
externalContext - the current ExternalContext
Returns:
User-specified ExpressionFactory, or null, if no no custom implementation was specified

loadExpressionFactory

protected static javax.el.ExpressionFactory loadExpressionFactory(String expressionFactoryClassName)
Loads and instantiates the given ExpressionFactory implementation.

Parameters:
expressionFactoryClassName - the class name of the ExpressionFactory implementation
Returns:
the newly created ExpressionFactory implementation, or null, if an error occurred

initStartupFacesContext

public FacesContext initStartupFacesContext(javax.servlet.ServletContext servletContext)
Specified by:
initStartupFacesContext in interface FacesInitializer

destroyStartupFacesContext

public void destroyStartupFacesContext(FacesContext facesContext)
Specified by:
destroyStartupFacesContext in interface FacesInitializer

initShutdownFacesContext

public FacesContext initShutdownFacesContext(javax.servlet.ServletContext servletContext)
Specified by:
initShutdownFacesContext in interface FacesInitializer

destroyShutdownFacesContext

public void destroyShutdownFacesContext(FacesContext facesContext)
Specified by:
destroyShutdownFacesContext in interface FacesInitializer

initContainerIntegration

protected abstract void initContainerIntegration(javax.servlet.ServletContext servletContext,
                                                 ExternalContext externalContext)
Performs initialization tasks depending on the current environment.

Parameters:
servletContext - the current ServletContext
externalContext - the current ExternalContext


Copyright © 2013 The Apache Software Foundation. All Rights Reserved.