Save This Page
Home » struts-2.0.11.2-src » org.apache » struts2 » components » [javadoc | source]
org.apache.struts2.components
public class: Form [javadoc | source]
java.lang.Object
   org.apache.struts2.components.Component
      org.apache.struts2.components.UIBean
         org.apache.struts2.components.ClosingUIBean
            org.apache.struts2.components.Form

Renders HTML an input form.

The remote form allows the form to be submitted without the page being refreshed. The results from the form can be inserted into any HTML element on the page.

NOTE:

The order / logic in determining the posting url of the generated HTML form is as follows:-

  1. If the action attribute is not specified, then the current request will be used to determine the posting url
  2. If the action is given, Struts will try to obtain an ActionConfig. This will be successfull if the action attribute is a valid action alias defined struts.xml.
  3. If the action is given and is not an action alias defined in struts.xml, Struts will used the action attribute as if it is the posting url, separting the namespace from it and using UrlHelper to generate the final url.

Examples


<s:form ... />

Field Summary
public static final  String OPEN_TEMPLATE     
public static final  String TEMPLATE     
protected  String onsubmit     
protected  String action     
protected  String target     
protected  String enctype     
protected  String method     
protected  String namespace     
protected  String validate     
protected  String portletMode     
protected  String windowState     
protected  String acceptcharset     
protected  boolean enableDynamicMethodInvocation     
protected  Configuration configuration     
protected  ObjectFactory objectFactory     
Fields inherited from org.apache.struts2.components.ClosingUIBean:
openTemplate
Fields inherited from org.apache.struts2.components.UIBean:
request,  response,  templateSuffix,  template,  templateDir,  theme,  key,  cssClass,  cssStyle,  disabled,  label,  labelPosition,  requiredposition,  name,  required,  tabindex,  value,  title,  onclick,  ondblclick,  onmousedown,  onmouseup,  onmouseover,  onmousemove,  onmouseout,  onfocus,  onblur,  onkeypress,  onkeydown,  onkeyup,  onselect,  onchange,  accesskey,  tooltip,  tooltipConfig,  defaultTemplateDir,  defaultUITheme,  templateEngineManager
Fields inherited from org.apache.struts2.components.Component:
COMPONENT_STACK,  stack,  parameters,  id,  actionMapper
Constructor:
 public Form(ValueStack stack,
    HttpServletRequest request,
    HttpServletResponse response) 
Method from org.apache.struts2.components.Form Summary:
evaluateExtraParams,   evaluateNameValue,   getDefaultOpenTemplate,   getDefaultTemplate,   getSequence,   getValidators,   populateComponentHtmlId,   setAcceptcharset,   setAction,   setConfiguration,   setEnableDynamicMethodInvocation,   setEnctype,   setMethod,   setNamespace,   setObjectFactory,   setOnsubmit,   setPortletMode,   setTarget,   setValidate,   setWindowState
Methods from org.apache.struts2.components.ClosingUIBean:
getDefaultOpenTemplate,   setOpenTemplate,   start
Methods from org.apache.struts2.components.UIBean:
addFormParameter,   buildTemplateName,   enableAncestorFormCustomOnsubmit,   end,   ensureAttributeSafelyNotEscaped,   escape,   evaluateExtraParams,   evaluateNameValue,   evaluateParams,   getDefaultTemplate,   getTemplate,   getTemplateDir,   getTheme,   getTooltipConfig,   getValueClassType,   mergeTemplate,   populateComponentHtmlId,   setAccesskey,   setCssClass,   setCssStyle,   setDefaultTemplateDir,   setDefaultUITheme,   setDisabled,   setKey,   setLabel,   setLabelposition,   setName,   setOnblur,   setOnchange,   setOnclick,   setOndblclick,   setOnfocus,   setOnkeydown,   setOnkeypress,   setOnkeyup,   setOnmousedown,   setOnmousemove,   setOnmouseout,   setOnmouseover,   setOnmouseup,   setOnselect,   setRequired,   setRequiredposition,   setTabindex,   setTemplate,   setTemplateDir,   setTemplateEngineManager,   setTheme,   setTitle,   setTooltip,   setTooltipConfig,   setValue
Methods from org.apache.struts2.components.Component:
addAllParameters,   addParameter,   altSyntax,   copyParams,   determineActionURL,   determineActionURL,   determineNamespace,   end,   end,   fieldError,   findAncestor,   findString,   findString,   findValue,   findValue,   findValue,   getComponentStack,   getId,   getParameters,   getStack,   popComponentStack,   setActionMapper,   setId,   start,   toString,   usesBody
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.struts2.components.Form Detail:
 protected  void evaluateExtraParams() 
 protected boolean evaluateNameValue() 
 public String getDefaultOpenTemplate() 
 protected String getDefaultTemplate() 
 protected int getSequence() 
    Get a incrementing sequence unique to this Form component. It is used by Form component's child that might need a sequence to make them unique.
 public List getValidators(String name) 
 protected  void populateComponentHtmlId(Form form) 
    The Form component determines its HTML element id as follows:-
    1. if an 'id' attribute is specified.
    2. if an 'action' attribute is specified, it will be used as the id.
 public  void setAcceptcharset(String acceptcharset) 
 public  void setAction(String action) 
 public  void setConfiguration(Configuration configuration) 
 public  void setEnableDynamicMethodInvocation(String enable) 
 public  void setEnctype(String enctype) 
 public  void setMethod(String method) 
 public  void setNamespace(String namespace) 
 public  void setObjectFactory(ObjectFactory objectFactory) 
 public  void setOnsubmit(String onsubmit) 
 public  void setPortletMode(String portletMode) 
 public  void setTarget(String target) 
 public  void setValidate(String validate) 
 public  void setWindowState(String windowState)