JSF-Spring

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

java.lang.Object
  extended by org.springframework.context.support.ApplicationObjectSupport
      extended by org.springframework.web.context.support.WebApplicationObjectSupport
          extended by org.springframework.web.servlet.support.WebContentGenerator
              extended by org.springframework.web.servlet.mvc.AbstractController
                  extended by de.mindmatters.faces.spring.context.servlet.FacesController
All Implemented Interfaces:
InitializingBean, ApplicationContextAware, ServletContextAware, Controller

public class FacesController
extends AbstractController
implements InitializingBean

FacesController 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
lifecycleId LifecycleFactory.DEFAULT_LIFECYCLE the identifier of the Lifecycle this Controller is delegating the request processing

Author:
Andreas Kuhrwahl
See Also:
FacesServlet

Field Summary
 
Fields inherited from class org.springframework.web.servlet.support.WebContentGenerator
METHOD_GET, METHOD_HEAD, METHOD_POST
 
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
 
Constructor Summary
FacesController()
           
 
Method Summary
 void afterPropertiesSet()
          Initializes the faces lifecycle this controller runs in.
protected  ModelAndView handleRequestInternal(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Executes the faces lifecycle.
protected  void initFacesController()
          This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.
 void setLifecycleId(java.lang.String lifecycleId)
          Sets the lifecycle id for identifying the proper lifecycle this controller will run in.
 
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, setServletContext
 
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
 

Constructor Detail

FacesController

public FacesController()
Method Detail

afterPropertiesSet

public final void afterPropertiesSet()
                              throws java.lang.Exception
Initializes the faces lifecycle this controller runs in.

Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
java.lang.Exception - in cases of errors

initFacesController

protected void initFacesController()
                            throws java.lang.Exception
This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

Throws:
java.lang.Exception - in the event of misconfiguration (such as failure to set an essential property) or if initialization fails.

setLifecycleId

public final void setLifecycleId(java.lang.String lifecycleId)
Sets the lifecycle id for identifying the proper lifecycle this controller will run in. If not set the LifecycleFactory.DEFAULT_LIFECYCLE will be used.

Parameters:
lifecycleId - the lifecycle id for identifying the proper lifecycle

handleRequestInternal

protected final ModelAndView handleRequestInternal(javax.servlet.http.HttpServletRequest request,
                                                   javax.servlet.http.HttpServletResponse response)
                                            throws java.lang.Exception
Executes the faces lifecycle.

Specified by:
handleRequestInternal in class AbstractController
Parameters:
request - current HTTP request
response - current HTTP response
Returns:
a ModelAndView to render
Throws:
java.lang.Exception - in case of errors
See Also:
AbstractController.handleRequest(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)

JSF-Spring

Copyright © 2006 mindmatters GmbH & Co. KG