SourceForge.net Logo

de.mindmatters.faces.spring.context.servlet.controller
Class Action

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.controller.Action
All Implemented Interfaces:
ApplicationContextAware, Controller, InitializingBean, ServletContextAware

public class Action
extends AbstractFacesController

This Controller executes the actions defined by the property actions or fromAction respectively. It uses the NavigationHandler to render the appropriate view (resolved by an outcome and the corresponding navigation rule).

Workflow

  1. execute the actions (must be method bindings) if not empty
  2. whether execute the fromAction (if it's a method binding and not null) or use it as an outcome if it's a string
  3. navigate with the help of the NavigationHandler and the evaluated outcome to the proper view and render it (the outcome of the last executed actions method binding is used if fromAction is null)

Exposed configuration properties:

name default description
actions Collections.EMPTY_LIST method bindings returning an outcome (public String doBar(){...}), e.g. #{foo.doBar}
fromAction null method binding returning an outcome (public String doBar(){...}), e.g. #{foo.doBar}, or a simple outcome (represented by a string)

Author:
Andreas Kuhrwahl

Field Summary
 
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
Action()
           
 
Method Summary
protected  ModelAndView handleRequestInternal(FacesContext context, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Template method. Subclasses must implement this. The contract is the same as for handleRequest.
protected  void initAction()
          Hook method for subclasses for initialization purposes.
protected  void initFacesController()
          Hook method for subclasses for initialization purposes.
 void setActions(java.util.List actions)
          Sets the actions.
 void setFromAction(java.lang.String action)
          Sets the from-action.
 
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
 

Constructor Detail

Action

public Action()
Method Detail

initFacesController

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

Overrides:
initFacesController in class AbstractFacesController

initAction

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


handleRequestInternal

protected final ModelAndView handleRequestInternal(FacesContext context,
                                                   javax.servlet.http.HttpServletRequest request,
                                                   javax.servlet.http.HttpServletResponse response)
Template method. Subclasses must implement this. The contract is the same as for handleRequest.

Specified by:
handleRequestInternal in class AbstractFacesController
Parameters:
context - current FacesContext
request - current HTTP request
response - current HTTP response
Returns:
a ModelAndView to render, or null if handled directly
See Also:
#handleRequest(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)

setFromAction

public final void setFromAction(java.lang.String action)
Sets the from-action.

Parameters:
action - the action to set

setActions

public final void setActions(java.util.List actions)
Sets the actions.

Parameters:
actions - the actions to set

SourceForge.net Logo

Copyright © 2002 mindmatters GmbH & Co. KG