SourceForge.net Logo

de.mindmatters.faces.spring.context.servlet
Class FacesLifecycleController

java.lang.Object
  extended byorg.springframework.context.support.ApplicationObjectSupport
      extended byorg.springframework.web.context.support.WebApplicationObjectSupport
          extended byorg.springframework.web.servlet.support.WebContentGenerator
              extended byorg.springframework.web.servlet.mvc.AbstractController
                  extended byde.mindmatters.faces.spring.context.servlet.AbstractFacesController
                      extended byde.mindmatters.faces.spring.context.servlet.FacesLifecycleController
All Implemented Interfaces:
ApplicationContextAware, Controller, InitializingBean, ServletContextAware

public class FacesLifecycleController
extends AbstractFacesController

FacesLifecycleController is a Controller that manages the request processing lifecycle for web applications that are utilizing JavaServer Faces to construct the user interface.

This Controller is an appropriate alternative for the FacesServlet.

Exposed configuration properties:

name default description
phaseListeners null a list of PhaseListeners used by the lifecycle this controller runs in

Author:
Andreas Kuhrwahl
See Also:
FacesServlet

Field Summary
static java.lang.String APPLICATION_ATTRIBUTE
          Request attribute to hold current JSF Application instance.
static java.lang.String LIFECYCLE_ATTRIBUTE
          Request attribute to hold current JSF lifecycle.
 
Fields inherited from class de.mindmatters.faces.spring.context.servlet.AbstractFacesController
log
 
Fields inherited from class org.springframework.web.servlet.support.WebContentGenerator
HEADER_CACHE_CONTROL, HEADER_EXPIRES, HEADER_PRAGMA, METHOD_GET, METHOD_HEAD, METHOD_POST
 
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
 
Constructor Summary
FacesLifecycleController()
           
 
Method Summary
protected  void addPhaseListener(PhaseListener listener)
          Adds a PhaseListener listener to the lifecycle this controller runs in.
protected  ModelAndView createModelAndView(FacesContext context, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Creates an empty ModelAndView with a FacesInternalResourceView.
protected  Application getApplication()
           
protected  PhaseListener[] getPhaseListeners()
           
protected  ModelAndView handleRequestInternal(FacesContext context, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Executes the faces lifecycle.
protected  void initFacesController()
          Hook method for subclasses for initialization purposes.
protected  void initLifecycle()
          Hook method for subclasses for initialization purposes.
protected  void removePhaseListener(PhaseListener listener)
          Removes a PhaseListener listener from the lifecycle this controller runs in.
 void setPhaseListeners(java.util.List phaseListeners)
          Adds the given PhaseListeners phaseListeners to the lifecycle this controller runs in.
 
Methods inherited from class de.mindmatters.faces.spring.context.servlet.AbstractFacesController
afterPropertiesSet, doAfterExecution, doBeforeExecution, getLifecycle, handleRequestInternal, setLifecycleId, setServletContext
 
Methods inherited from class org.springframework.web.servlet.mvc.AbstractController
handleRequest, isSynchronizeOnSession, setSynchronizeOnSession
 
Methods inherited from class org.springframework.web.servlet.support.WebContentGenerator
applyCacheSeconds, applyCacheSeconds, cacheForSeconds, cacheForSeconds, checkAndPrepare, checkAndPrepare, getCacheSeconds, getSupportedMethods, isRequireSession, isUseCacheControlHeader, isUseExpiresHeader, preventCaching, setCacheSeconds, setRequireSession, setSupportedMethods, setUseCacheControlHeader, setUseExpiresHeader
 
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, isContextRequired
 
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, initApplicationContext, requiredContextClass, setApplicationContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

APPLICATION_ATTRIBUTE

public static final java.lang.String APPLICATION_ATTRIBUTE
Request attribute to hold current JSF Application instance.


LIFECYCLE_ATTRIBUTE

public static final java.lang.String LIFECYCLE_ATTRIBUTE
Request attribute to hold current JSF lifecycle.

Constructor Detail

FacesLifecycleController

public FacesLifecycleController()
Method Detail

initFacesController

protected final void initFacesController()
Hook method for subclasses for initialization purposes.

Overrides:
initFacesController in class AbstractFacesController

initLifecycle

protected void initLifecycle()
Hook method for subclasses for initialization purposes.


createModelAndView

protected ModelAndView createModelAndView(FacesContext context,
                                          javax.servlet.http.HttpServletRequest request,
                                          javax.servlet.http.HttpServletResponse response)
Creates an empty ModelAndView with a FacesInternalResourceView. So resolving and creation of the view will be suppressed (it's usually already done by the currently used NavigationHandler).

Subclasses can override this method.

Parameters:
context - current FacesContext
request - current HTTP request
response - current HTTP response
Returns:
a ModelAndView to render

handleRequestInternal

protected final ModelAndView handleRequestInternal(FacesContext context,
                                                   javax.servlet.http.HttpServletRequest request,
                                                   javax.servlet.http.HttpServletResponse response)
Executes the faces lifecycle.

Specified by:
handleRequestInternal in class AbstractFacesController
Parameters:
context - current FacesContext
request - current HTTP request
response - current HTTP response
Returns:
a ModelAndView to render
See Also:
createModelAndView(FacesContext, HttpServletRequest, HttpServletResponse)

setPhaseListeners

public final void setPhaseListeners(java.util.List phaseListeners)
Adds the given PhaseListeners phaseListeners to the lifecycle this controller runs in.

Parameters:
phaseListeners - the listener to add

removePhaseListener

protected final void removePhaseListener(PhaseListener listener)
Removes a PhaseListener listener from the lifecycle this controller runs in.

Parameters:
listener - the listener to remove

addPhaseListener

protected final void addPhaseListener(PhaseListener listener)
Adds a PhaseListener listener to the lifecycle this controller runs in.

Parameters:
listener - the listener to add

getPhaseListeners

protected final PhaseListener[] getPhaseListeners()
Returns:
the PhaseListeners used by the lifecycle this controller runs in

getApplication

protected final Application getApplication()
Returns:
the currently used JSF Application instance

SourceForge.net Logo

Copyright © 2002 mindmatters GmbH & Co. KG