Class AbstractFormDrivenActionSupport<F extends Form>

java.lang.Object
org.apache.struts2.ActionSupport
com.opensymphony.xwork2.ActionSupport
name.matthewgreet.strutscommons.action.AbstractActionSupport
name.matthewgreet.strutscommons.action.AbstractFormDrivenActionSupport<F>
Type Parameters:
F - Form containing request parameters.
All Implemented Interfaces:
com.opensymphony.xwork2.Action, com.opensymphony.xwork2.interceptor.ValidationAware, com.opensymphony.xwork2.LocaleProvider, com.opensymphony.xwork2.ModelDriven<F>, com.opensymphony.xwork2.TextProvider, com.opensymphony.xwork2.Validateable, Serializable, BrowserTabAware, BrowserTabAware2, FormDriven<F>, org.apache.struts2.action.Action, org.apache.struts2.action.ServletRequestAware, org.apache.struts2.interceptor.ValidationAware, org.apache.struts2.ModelDriven<F>, org.apache.struts2.Validateable

public abstract class AbstractFormDrivenActionSupport<F extends Form> extends AbstractActionSupport implements FormDriven<F>
Base class of Struts 2 Action for finding or updating based on form data, or otherwise respond to POST requests. Concrete subclasses are expected to use an interceptor stack like FormDrivenStack; see interceptor package.
See Also:
  • Nested Class Summary

    Nested classes/interfaces inherited from interface com.opensymphony.xwork2.interceptor.ValidationAware

    com.opensymphony.xwork2.interceptor.ValidationAware.LegacyAdapter
  • Field Summary

    Fields inherited from class org.apache.struts2.ActionSupport

    container

    Fields inherited from interface org.apache.struts2.action.Action

    ERROR, INPUT, LOGIN, NONE, SUCCESS
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Returns whether the user's request was rejected, such as form data itself is invalid, an update rejected by the back-end or zero query results with zero results not allowed.
    protected F
     
     
    protected abstract F
    Returns a new instance of the form.
    protected void
    setForm(F form)
     
    void
     

    Methods inherited from class name.matthewgreet.strutscommons.action.AbstractActionSupport

    getBrowserTabSession, getLogger, getServletRequest, getTabId, setBrowserTabSession, setTabId, withServletRequest

    Methods inherited from class org.apache.struts2.ActionSupport

    addActionError, addActionMessage, addFieldError, clearActionErrors, clearErrors, clearErrorsAndMessages, clearFieldErrors, clearMessages, clone, execute, getActionErrors, getActionMessages, getContainer, getFieldErrors, getFormatted, getLocale, getLocaleProvider, getText, getText, getText, getText, getText, getText, getText, getText, getText, getTextProvider, getTexts, getTexts, hasActionErrors, hasActionMessages, hasErrors, hasFieldErrors, hasKey, input, isValidLocale, isValidLocaleString, pause, setActionErrors, setActionMessages, setContainer, setFieldErrors, toLocale

    Methods inherited from class java.lang.Object

    equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.apache.struts2.action.Action

    execute

    Methods inherited from interface name.matthewgreet.strutscommons.action.BrowserTabAware2

    copyAttributesFromOldTabToNewTab, handleAttributeFailures

    Methods inherited from interface org.apache.struts2.interceptor.ValidationAware

    addActionError, addActionMessage, addFieldError, getActionErrors, getActionMessages, getFieldErrors, hasActionErrors, hasActionMessages, hasErrors, hasFieldErrors, setActionErrors, setActionMessages, setFieldErrors
  • Constructor Details

    • AbstractFormDrivenActionSupport

      public AbstractFormDrivenActionSupport()
  • Method Details

    • makeForm

      protected abstract F makeForm()
      Returns a new instance of the form.
    • getForm

      protected F getForm()
    • setForm

      protected void setForm(F form)
    • formValidationFailed

      public boolean formValidationFailed()
      Description copied from interface: FormDriven
      Returns whether the user's request was rejected, such as form data itself is invalid, an update rejected by the back-end or zero query results with zero results not allowed. This is usually defined as the presence of any error messages.
      Specified by:
      formValidationFailed in interface FormDriven<F extends Form>
    • getModel

      public F getModel()
      Specified by:
      getModel in interface org.apache.struts2.ModelDriven<F extends Form>
    • validate

      public void validate()
      Specified by:
      validate in interface org.apache.struts2.Validateable
      Overrides:
      validate in class org.apache.struts2.ActionSupport