Class AbstractPopulateActionForm

java.lang.Object
org.apache.struts.chain.commands.ActionCommandBase
org.apache.struts.chain.commands.AbstractPopulateActionForm
All Implemented Interfaces:
Command<ActionContext>, ActionCommand
Direct Known Subclasses:
PopulateActionForm

public abstract class AbstractPopulateActionForm extends ActionCommandBase

Populate the form bean (if any) for this request.

Version:
$Rev$ $Date: 2005-11-12 13:01:44 -0500 (Sat, 12 Nov 2005) $
  • Constructor Details

    • AbstractPopulateActionForm

      public AbstractPopulateActionForm()
  • Method Details

    • execute_

      protected boolean execute_(ActionContext actionCtx) throws Exception

      Populate the form bean (if any) for this request.

      Specified by:
      execute_ in class ActionCommandBase
      Parameters:
      actionCtx - The Context for the current request
      Returns:
      false so that processing continues
      Throws:
      Exception - On an unexpected error
    • isReset

      protected abstract boolean isReset(ActionContext context, ActionConfig actionConfig)
      Determines whether an action form should be reset
      Parameters:
      context - the ActionContext we are processing
      actionConfig - action config for current request
      Returns:
      true if action form should be reset
      Since:
      Struts 1.4
    • isPopulate

      protected abstract boolean isPopulate(ActionContext context, ActionConfig actionConfig)
      Determines whether an action form should be populated.
      Parameters:
      context - the ActionContext we are processing
      actionConfig - action config for current request
      Returns:
      true if action form should be populated
      Since:
      Struts 1.4
    • reset

      protected abstract void reset(ActionContext context, ActionConfig actionConfig, ActionForm actionForm)

      Call the reset() method on the specified form bean.

      Parameters:
      context - The context for this request
      actionConfig - The actionConfig for this request
      actionForm - The form bean for this request
    • populate

      protected abstract void populate(ActionContext context, ActionConfig actionConfig, ActionForm actionForm) throws Exception

      Populate the given ActionForm with request parameter values, taking into account any prefix/suffix values configured on the given ActionConfig.

      Parameters:
      context - The ActionContext we are processing
      actionConfig - The ActionConfig we are processing
      actionForm - The ActionForm we are processing
      Throws:
      Exception - On an unexpected error
    • trimParameterName

      protected String trimParameterName(ActionConfig actionConfig, String name)

      For a given request parameter name, trim off any prefix and/or suffix which are defined in actionConfig and return what remains. If either prefix or suffix is defined, then return null for name values which do not begin or end accordingly.

      Parameters:
      actionConfig - The ActionConfig we are processing
      name - The request parameter name to proceess
      Returns:
      The request parameter name trimmed of any suffix or prefix
    • handleCancel

      protected void handleCancel(ActionContext context, ActionConfig actionConfig, ActionForm actionForm) throws Exception

      Take into account whether the request includes any defined value for the global "cancel" parameter.

      An issue was raised (but I don't think a Bugzilla ticket created) about the security implications of using a well-known cancel property which skips form validation, as you may not write your actions to deal with the cancellation case.

      Parameters:
      context - The ActionContext we are processing
      actionConfig - The ActionConfig we are processing
      actionForm - The ActionForm we are processing
      Throws:
      Exception - On an unexpected error
      See Also: