live.struts.actions
Class CheckedAction

java.lang.Object
  extended byorg.apache.struts.action.Action
      extended bylive.struts.actions.CheckedAction
Direct Known Subclasses:
DisplayAction, SwitchedAction

public abstract class CheckedAction
extends org.apache.struts.action.Action

This class takes care of much of the tedious mucking about that we used to have to do at the beginning of every Action. Specifically, it:

You use this class the same way you would Action, except you implement the act(CheckedAction.ActionInfo) method instead of execute. Rather than pass all four parameters we had before plus the cache plus whatever else we may think is useful in the future to the subclasses, there is a class used like a C struct (CheckedAction.ActionInfo) that we put all that in and just pass that.

Author:
Evan Driscoll

Nested Class Summary
static class CheckedAction.ActionInfo
           
 
Field Summary
 
Fields inherited from class org.apache.struts.action.Action
defaultLocale, servlet
 
Constructor Summary
CheckedAction()
           
 
Method Summary
abstract  org.apache.struts.action.ActionForward act(CheckedAction.ActionInfo info)
          This is called automagically when a request is made.
 org.apache.struts.action.ActionForward execute(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, HttpServletRequest request, HttpServletResponse response)
          This function does the behind-the-scenes magic of all the tedious mucking about mentioned above.
 
Methods inherited from class org.apache.struts.action.Action
addErrors, addMessages, execute, generateToken, getDataSource, getDataSource, getErrors, getLocale, getMessages, getResources, getResources, getServlet, isCancelled, isTokenValid, isTokenValid, resetToken, saveErrors, saveErrors, saveErrors, saveMessages, saveMessages, saveToken, setLocale, setServlet
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CheckedAction

public CheckedAction()
Method Detail

execute

public final org.apache.struts.action.ActionForward execute(org.apache.struts.action.ActionMapping mapping,
                                                            org.apache.struts.action.ActionForm form,
                                                            HttpServletRequest request,
                                                            HttpServletResponse response)
                                                     throws InterruptedException,
                                                            UnsupportedEncodingException
This function does the behind-the-scenes magic of all the tedious mucking about mentioned above.

Throws:
InterruptedException
UnsupportedEncodingException
See Also:
Action.execute(org.apache.struts.action.ActionMapping, org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)

act

public abstract org.apache.struts.action.ActionForward act(CheckedAction.ActionInfo info)
This is called automagically when a request is made. Implement this method when subclassing this to do something.

Parameters:
info - Holds the parameters that were passed to execute, plus things like the cache and threads info deduced from those parameters
Returns:
An object that implements getForward
Throws:
InterruptedException


Copyright © 2005