org.apache.struts2.components
类 Form

java.lang.Object
  继承者 org.apache.struts2.components.Component
      继承者 org.apache.struts2.components.UIBean
          继承者 org.apache.struts2.components.ClosingUIBean
              继承者 org.apache.struts2.components.Form

public class Form
extends ClosingUIBean

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 ... />


嵌套类摘要
static class Form.FieldVisitorValidatorWrapper
          Wrap field validator, add visitor's field prefix to the field name.
 
字段摘要
static String OPEN_TEMPLATE
           
static String TEMPLATE
           
 
从类 org.apache.struts2.components.Component 继承的字段
COMPONENT_STACK
 
构造方法摘要
Form(com.opensymphony.xwork2.util.ValueStack stack, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
           
 
方法摘要
 String getDefaultOpenTemplate()
           
 List getValidators(String name)
           
 void setAcceptcharset(String acceptcharset)
           
 void setAction(String action)
           
 void setActionValidatorManager(com.opensymphony.xwork2.validator.ActionValidatorManager mgr)
           
 void setConfiguration(com.opensymphony.xwork2.config.Configuration configuration)
           
 void setEnctype(String enctype)
           
 void setFocusElement(String focusElement)
           
 void setIncludeContext(boolean includeContext)
           
 void setMethod(String method)
           
 void setNamespace(String namespace)
           
 void setObjectFactory(com.opensymphony.xwork2.ObjectFactory objectFactory)
           
 void setOnreset(String onreset)
           
 void setOnsubmit(String onsubmit)
           
 void setPortletMode(String portletMode)
           
 void setTarget(String target)
           
 void setUrlRenderer(UrlRenderer urlRenderer)
           
 void setValidate(String validate)
           
 void setWindowState(String windowState)
           
 
从类 org.apache.struts2.components.ClosingUIBean 继承的方法
setOpenTemplate, start
 
从类 org.apache.struts2.components.UIBean 继承的方法
addFormParameter, copyParams, end, evaluateParams, getId, getTemplate, getTemplateDir, getTheme, setAccesskey, setCssClass, setCssErrorClass, setCssErrorStyle, setCssStyle, setDefaultTemplateDir, setDefaultUITheme, setDisabled, setDynamicAttributes, setErrorPosition, setId, setJavascriptTooltip, setKey, setLabel, setLabelposition, setLabelSeparator, setName, setOnblur, setOnchange, setOnclick, setOndblclick, setOnfocus, setOnkeydown, setOnkeypress, setOnkeyup, setOnmousedown, setOnmousemove, setOnmouseout, setOnmouseover, setOnmouseup, setOnselect, setRequiredLabel, setRequiredPosition, setTabindex, setTemplate, setTemplateDir, setTemplateEngineManager, setTheme, setTitle, setTooltip, setTooltipConfig, setTooltipCssClass, setTooltipDelay, setTooltipIconPath, setUIThemeExpansionToken, setValue
 
从类 org.apache.struts2.components.Component 继承的方法
addAllParameters, addParameter, altSyntax, getComponentStack, getParameters, getStack, setActionMapper, setThrowExceptionsOnELFailure, setUrlHelper, usesBody
 
从类 java.lang.Object 继承的方法
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

字段详细信息

OPEN_TEMPLATE

public static final String OPEN_TEMPLATE
另请参见:
常量字段值

TEMPLATE

public static final String TEMPLATE
另请参见:
常量字段值
构造方法详细信息

Form

public Form(com.opensymphony.xwork2.util.ValueStack stack,
            javax.servlet.http.HttpServletRequest request,
            javax.servlet.http.HttpServletResponse response)
方法详细信息

getDefaultOpenTemplate

public String getDefaultOpenTemplate()
指定者:
ClosingUIBean 中的 getDefaultOpenTemplate

setConfiguration

public void setConfiguration(com.opensymphony.xwork2.config.Configuration configuration)

setObjectFactory

public void setObjectFactory(com.opensymphony.xwork2.ObjectFactory objectFactory)

setUrlRenderer

public void setUrlRenderer(UrlRenderer urlRenderer)

setActionValidatorManager

public void setActionValidatorManager(com.opensymphony.xwork2.validator.ActionValidatorManager mgr)

getValidators

public List getValidators(String name)

setOnsubmit

public void setOnsubmit(String onsubmit)

setOnreset

public void setOnreset(String onreset)

setAction

public void setAction(String action)

setTarget

public void setTarget(String target)

setEnctype

public void setEnctype(String enctype)

setMethod

public void setMethod(String method)

setNamespace

public void setNamespace(String namespace)

setValidate

public void setValidate(String validate)

setPortletMode

public void setPortletMode(String portletMode)

setWindowState

public void setWindowState(String windowState)

setAcceptcharset

public void setAcceptcharset(String acceptcharset)

setFocusElement

public void setFocusElement(String focusElement)

setIncludeContext

public void setIncludeContext(boolean includeContext)