# com.bea.wlw.netui.tags.html
Form Class

public class Form
extends `AbstractBaseTag`
implements `IAttributeConsumer`, `URLParams`

This tag represents an input form, associated with a bean whose properties correspond to the various fields of the form.

Attribute Descriptions
Attribute | Required | Runtime Expression Evaluation | Data Bindable
--- | --- | --- | ---
action | Yes | No | No
Required. The action invoked by submitting the Form.
encType | No | No | No
The content encoding to be used on a post submit.
focus | No | No | No
The tagID of a nested Netui tag which should receive the focus.
location | No | No | No
The location hash to append to the url.
method | No | No | No
The request method used when submitting this form.
name | No | No | No
The attribute key under which the associated ActionForm bean used to populate the input form is stored. This ActionForm is found in the scope defined by the `scope` attribute.
scope | No | No | No
The scope ('request' or 'session') under which the associated ActionForm bean used to populate the form input fields is stored. Using the `name`, `type` and `scope` attributes defines an the ActionForm object used.
tagId | No | No | No
The ID of this button used by the enclosing html tag to get the tag's real ID attribute for javascript and focus purposes. The real ID attribute id is generated based upon this name.
target | No | No | No
The window target
type | No | No | No
The Java class name of the ActionForm bean to be created, if necessary. This bean will be created if the `name` and `scope` attributes are set. The bean is then used to populate the form input fields.

Related Topics

<netui:form> Tag Sample
Using Form Beans to Encapsulate Data

Hierarchy
  `Object`
  `TagSupport`
  `BodyTagSupport`
  `AbstractBaseTag`
  `Form`

All Implemented Interfaces
  `BodyTag`, `IAttributeConsumer`, `IterationTag`, `Serializable`, `Tag`, `URLParams`

## Field Summary

`public static final `String`` | `ACTION` String
`protected `String`` | `beanScope` The scope of the form bean to (create and) use.
`protected `String`` | `beanType` The type of the form bean to (create and) use.
`protected `String`` | `enctype` The content encoding to be used on a post submit.
`protected `String`` | `focus` The name of the field to receive focus, if any.
`protected `String`` | `location` The location hash to append to the url.
`protected `String`` | `method` The request method used when submitting this form.
`public static final `String`` | `METHOD` String
`protected `String`` | `name` The attribute key under which our associated bean is stored.
`protected `String`` | `scope` The scope (request or session) under which our associated bean is stored.
`protected `String`` | `target` The window target.
`protected `String`` | `type` The Java class name of the bean to be created, if necessary.

Fields from com.bea.wlw.netui.tags`.`AbstractBaseTag``
``ATTR_GENERAL`, `ATTR_GENERAL_EXPRESSION`, `ATTR_JAVASCRIPT`, `ATTR_STYLE`, `CLASS`, `ID`, `JAVASCRIPT_STATUS`, `NAME`, `NETUI_UNIQUE_CNT`, `ONCLICK`, `ONDBLCLICK`, `ONKEYDOWN`, `ONKEYPRESS`, `ONKEYUP`, `ONMOUSEDOWN`, `ONMOUSEMOVE`, `ONMOUSEOUT`, `ONMOUSEOVER`, `ONMOUSEUP`, `STYLE`, `TABINDEX``

Fields from javax.servlet.jsp.tagext`.`BodyTagSupport``
`bodyContent`

Fields from javax.servlet.jsp.tagext`.`TagSupport``
`id, pageContext`

Fields from interface javax.servlet.jsp.tagext`.`BodyTag``
`EVAL_BODY_BUFFERED, EVAL_BODY_TAG`

Fields from interface javax.servlet.jsp.tagext`.`IterationTag``
`EVAL_BODY_AGAIN`

Fields from interface javax.servlet.jsp.tagext`.`Tag``
`EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE`

## Constructor Summary

Form()

## Method Summary

`public void` | `addParameter`(`String` name, `Object` value) Adds a URL parameter to the generated hyperlink.
`public void` | `addTagID`(`String` tagID, `String` name) Adds a tagId and name to the Form's focusMap.
`public int` | `doAfterBody`() Save the body content of the Form.
`public int` | `doEndTag`() Render the end of this form.
`public int` | `doStartTag`() Render the beginning of this form.
`public void` | `generateRealName`()
`public `String`` | `getAction`() Return the action of the Form.
`public `String`` | `getBeanName`() Return the name of the form bean corresponding to this tag.
`public `String`` | `getEnctype`() Return the content encoding to be used on a post submit.
`public `String`` | `getFocus`() Return the name of the field to receive focus.
`public `String`` | `getLocation`() Return the location hash to append to the url.
`public `String`` | `getMethod`() Return request method used when submitting this form.
`public `String`` | `getName`() Return the attribute key under which our associated bean is stored.
`public `String`` | `getOnClick`() Gets the onClick javascript event.
`public `String`` | `getOnDblClick`() Gets the onDblClick javascript event.
`public `String`` | `getOnKeyDown`() Gets the onKeyDown javascript event.
`public `String`` | `getOnKeyPress`() Gets the onKeyPress javascript event.
`public `String`` | `getOnKeyUp`() Gets the onKeyUp javascript event.
`public `String`` | `getOnMouseDown`() Gets the onMouseDown javascript event.
`public `String`` | `getOnMouseMove`() Gets the onMouseMove javascript event.
`public `String`` | `getOnMouseOut`() Gets the onMouseOut javascript event.
`public `String`` | `getOnMouseOver`() Gets the onMouseOver javascript event.
`public `String`` | `getOnMouseUp`() Gets the onMouseUp javascript event.
`public `String`` | `getOnReset`() Gets the onReset javascript event.
`public `String`` | `getOnSubmit`() Gets the onSubmit javascript event.
`public `String`` | `getRealName`() this is used to
`public `String`` | `getScope`() Gets the scope (request or session) under which the associated bean is stored.
`public `String`` | `getStyle`() Gets the style of the rendered html tag.
`public `String`` | `getStyleClass`() Gets the style class of the rendered html tag.
`public `String`` | `getTabindex`() Gets the tabIndex of the rendered html tag.
`public `String`` | `getTagId`() Return the ID of the form.
`public `String`` | `getTagName`() Return the name of the Tag.
`public `String`` | `getTarget`() Gets the window target.
`public `String`` | `getType`() Gets the Java class name of the bean to be created, if necessary.
`protected void` | `localRelease`() Release any acquired resources.
`public void` | `setAction`(`String` action) Set the name of the action for the Form.
`public void` | `setAttribute`(`String` name, `String` value) Set an attribute value.
`public void` | `setEnctype`(`String` enctype) Set the content encoding to be used on a post submit.
`public void` | `setFocus`(`String` focus) Set the name of the field to receive focus.
`public void` | `setLocation`(`String` location) Set the location hash to append to the url.
`public void` | `setMethod`(`String` method) Set the request method used when submitting this form.
`public void` | `setName`(`String` name) Set the attribute key under which our associated bean is stored.
`public void` | `setOnClick`(`String` onclick) Sets the onClick javascript event.
`public void` | `setOnDblClick`(`String` ondblclick) Sets the onDblClick javascript event.
`public void` | `setOnKeyDown`(`String` onkeydown) Sets the onKeyDown javascript event.
`public void` | `setOnKeyPress`(`String` onkeypress) Sets the onKeyPress javascript event.
`public void` | `setOnKeyUp`(`String` onkeyup) Sets the onKeyUp javascript event.
`public void` | `setOnMouseDown`(`String` onmousedown) Sets the onMouseDown javascript event.
`public void` | `setOnMouseMove`(`String` onmousemove) Sets the onMouseMove javascript event.
`public void` | `setOnMouseOut`(`String` onmouseout) Sets the onMouseOut javascript event.
`public void` | `setOnMouseOver`(`String` onmouseover) Sets the onMouseOver javascript event.
`public void` | `setOnMouseUp`(`String` onmouseup) Sets the onMouseUp javascript event.
`public void` | `setOnReset`(`String` onReset) Sets the onReset javascript event.
`public void` | `setOnSubmit`(`String` onSubmit) Sets the onSubmit javascript event.
`public void` | `setScope`(`String` scope) Sets the scope (request or session) under which the associated bean is stored.
`public void` | `setStyle`(`String` style) Sets the style of the rendered html tag.
`public void` | `setStyleClass`(`String` styleClass) Sets the style class of the rendered html tag.
`public void` | `setTabindex`(`String` tabindex) Sets the tabIndex of the rendered html tag.
`public void` | `setTagId`(`String` tagID) Set the ID of the form.
`public void` | `setTarget`(`String` target) Sets the window target.
`public void` | `setType`(`String` type) Sets the Java class name of the bean to be created, if necessary.

Methods from `com.bea.wlw.netui.tags.`AbstractBaseTag``
``addTagIdMapping`, `evaluateAttributeToString`, `filter`, `filter`, `getJavaScriptUtils`, `getNearestForm`, `getScriptReporter`, `getUserLocale`, `registerTagError`, `release`, `renderAttribute`, `rewriteName`, `write``

Methods from `javax.servlet.jsp.tagext.`BodyTagSupport``
`doInitBody, getBodyContent, getPreviousOut, release, setBodyContent`

Methods from `javax.servlet.jsp.tagext.`TagSupport``
`doAfterBody, doEndTag, doStartTag, findAncestorWithClass, getId, getParent, getValue, getValues, release, removeValue, setId, setPageContext, setParent, setValue`

Methods from class `java.lang.`Object``
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Methods from interface `javax.servlet.jsp.tagext.`BodyTag``
`doInitBody, setBodyContent`

Methods from interface `com.bea.wlw.netui.tags.`IAttributeConsumer``
``setAttribute``

Methods from interface `javax.servlet.jsp.tagext.`IterationTag``
`doAfterBody`

Methods from interface `javax.servlet.jsp.tagext.`Tag``
`doEndTag, doStartTag, getParent, release, setPageContext, setParent`

Methods from interface `com.bea.wlw.netui.tags.html.`URLParams``
``addParameter``

## Field Detail

### ACTION

    public static final String ACTION

### beanScope

    protected String beanScope

  The scope of the form bean to (create and) use. This is either the same as the 'scope' attribute, if that was specified, or is obtained from the associated `ActionMapping` otherwise.

### beanType

    protected String beanType

  The type of the form bean to (create and) use. This is either the same as the 'type' attribute, if that was specified, or is obtained from the associated `ActionMapping` otherwise.

### enctype

    protected String enctype

  The content encoding to be used on a post submit.

### focus

    protected String focus

  The name of the field to receive focus, if any.

### location

    protected String location

  The location hash to append to the url.

### method

    protected String method

  The request method used when submitting this form.

### METHOD

    public static final String METHOD

### name

    protected String name

  The attribute key under which our associated bean is stored.

### scope

    protected String scope

  The scope (request or session) under which our associated bean is stored.

### target

    protected String target

  The window target.

### type

    protected String type

  The Java class name of the bean to be created, if necessary.

## Constructor Detail

### Form

    public Form()

## Method Detail

### addParameter(String, Object) Method

    public void addParameter(String name,
                             Object value)
         throws JspException

Adds a URL parameter to the generated hyperlink.

#### Parameters

name
  - the name of the parameter to be added.

value
  - the value of the parameter to be added (a String or String[]).

#### Exceptions

``JspException``

### addTagID(String, String) Method

    public void addTagID(String tagID,
                         String name)

Adds a tagId and name to the Form's focusMap.

#### Parameters

tagID
  - the tagID of a child tag.

name
  - the name of a child tag.

### doAfterBody() Method

    public int doAfterBody()
         throws JspException

Save the body content of the Form.

Overrides
  `BodyTagSupport.doAfterBody()`

#### Exceptions

``JspException``
  if a JSP exception has occurred

### doEndTag() Method

    public int doEndTag()
         throws JspException

Render the end of this form.

Overrides
  `BodyTagSupport.doEndTag()`

#### Exceptions

``JspException``
  if a JSP exception has occurred

### doStartTag() Method

    public int doStartTag()
         throws JspException

Render the beginning of this form.

Overrides
  `BodyTagSupport.doStartTag()`

#### Exceptions

``JspException``
  if a JSP exception has occurred

### generateRealName() Method

    public void generateRealName()

### getAction() Method

    public String getAction()

Return the action of the Form.

#### Returns

a String representing the action name of the Form.

### getBeanName() Method

    public String getBeanName()

Return the name of the form bean corresponding to this tag. There is no corresponding setter method; this method exists so that the nested tag classes can obtain the actual bean name derived from other attributes of the tag.

### getEnctype() Method

    public String getEnctype()

Return the content encoding to be used on a post submit.

#### Returns

the content encoding type.

### getFocus() Method

    public String getFocus()

Return the name of the field to receive focus.

#### Returns

the focus field name

### getLocation() Method

    public String getLocation()

Return the location hash to append to the url.

#### Returns

the location hash

### getMethod() Method

    public String getMethod()

Return request method used when submitting this form.

#### Returns

the request method

### getName() Method

    public String getName()

Return the attribute key under which our associated bean is stored.

#### Returns

the attribute key name

### getOnClick() Method

    public String getOnClick()

Gets the onClick javascript event.

#### Returns

the onClick event.

### getOnDblClick() Method

    public String getOnDblClick()

Gets the onDblClick javascript event.

#### Returns

the onDblClick event.

### getOnKeyDown() Method

    public String getOnKeyDown()

Gets the onKeyDown javascript event.

#### Returns

the onKeyDown event.

### getOnKeyPress() Method

    public String getOnKeyPress()

Gets the onKeyPress javascript event.

#### Returns

the onKeyPress event.

### getOnKeyUp() Method

    public String getOnKeyUp()

Gets the onKeyUp javascript event.

#### Returns

the onKeyUp event.

### getOnMouseDown() Method

    public String getOnMouseDown()

Gets the onMouseDown javascript event.

#### Returns

the onMouseDown event.

### getOnMouseMove() Method

    public String getOnMouseMove()

Gets the onMouseMove javascript event.

#### Returns

the onMouseMove event.

### getOnMouseOut() Method

    public String getOnMouseOut()

Gets the onMouseOut javascript event.

#### Returns

the onMouseOut event.

### getOnMouseOver() Method

    public String getOnMouseOver()

Gets the onMouseOver javascript event.

#### Returns

the onMouseOver event.

### getOnMouseUp() Method

    public String getOnMouseUp()

Gets the onMouseUp javascript event.

#### Returns

the onMouseUp event.

### getOnReset() Method

    public String getOnReset()

Gets the onReset javascript event.

#### Returns

the onReset event.

### getOnSubmit() Method

    public String getOnSubmit()

Gets the onSubmit javascript event.

#### Returns

the onSubmit event.

### getRealName() Method

    public String getRealName()

this is used to

### getScope() Method

    public String getScope()

Gets the scope (request or session) under which the associated bean is stored.

#### Returns

the scope.

### getStyle() Method

    public String getStyle()

Gets the style of the rendered html tag.

#### Returns

the style.

### getStyleClass() Method

    public String getStyleClass()

Gets the style class of the rendered html tag.

#### Returns

the style class.

### getTabindex() Method

    public String getTabindex()

Gets the tabIndex of the rendered html tag.

#### Returns

the tabindex.

### getTagId() Method

    public String getTagId()

Return the ID of the form.

#### Returns

the ID.

### getTagName() Method

    public String getTagName()

Return the name of the Tag.

Overrides
  `AbstractBaseTag.getTagName()`

### getTarget() Method

    public String getTarget()

Gets the window target.

#### Returns

the window target.

### getType() Method

    public String getType()

Gets the Java class name of the bean to be created, if necessary.

#### Returns

the class name.

### localRelease() Method

    protected void localRelease()

Release any acquired resources.

Overrides
  `AbstractBaseTag.localRelease()`

### setAction(String) Method

    public void setAction(String action)

Set the name of the action for the Form.

#### Parameters

action
  - the name of the action to set for the Form.

### setAttribute(String, String) Method

    public void setAttribute(String name,
                             String value)
         throws JspException

Set an attribute value. The `name` represents the name of the attribute. The `value` represents the value and may contain a netui expression. This method may result in errors being generated. This requires that the tag buffer its body and write attributes in the end tag. For the form tag it is not legal to set the `id`, `name`, `action`, or `method` attributes with this method.

#### Parameters

name
  The name of the attribute. This value may not be null or the empty string.

value
  The value of the attribute. This may contain a netui expression.

#### Exceptions

``JspException``
  A JspException may be thrown if there is an error setting the attribute.

### setEnctype(String) Method

    public void setEnctype(String enctype)

Set the content encoding to be used on a post submit.

#### Parameters

enctype
  - the content encoding type.

### setFocus(String) Method

    public void setFocus(String focus)

Set the name of the field to receive focus.

#### Parameters

focus
  - the focus field name.

### setLocation(String) Method

    public void setLocation(String location)

Set the location hash to append to the url.

#### Parameters

location
  - the location hash

### setMethod(String) Method

    public void setMethod(String method)

Set the request method used when submitting this form.

#### Parameters

method
  - the request method

### setName(String) Method

    public void setName(String name)

Set the attribute key under which our associated bean is stored.

#### Parameters

name
  - the attribute key name

### setOnClick(String) Method

    public void setOnClick(String onclick)

Sets the onClick javascript event.

#### Parameters

onclick
  - the onClick event.

### setOnDblClick(String) Method

    public void setOnDblClick(String ondblclick)

Sets the onDblClick javascript event.

#### Parameters

ondblclick
  - the onDblClick event.

### setOnKeyDown(String) Method

    public void setOnKeyDown(String onkeydown)

Sets the onKeyDown javascript event.

#### Parameters

onkeydown
  - the onKeyDown event.

### setOnKeyPress(String) Method

    public void setOnKeyPress(String onkeypress)

Sets the onKeyPress javascript event.

#### Parameters

onkeypress
  - the onKeyPress event.

### setOnKeyUp(String) Method

    public void setOnKeyUp(String onkeyup)

Sets the onKeyUp javascript event.

#### Parameters

onkeyup
  - the onKeyUp event.

### setOnMouseDown(String) Method

    public void setOnMouseDown(String onmousedown)

Sets the onMouseDown javascript event.

#### Parameters

onmousedown
  - the onMouseDown event.

### setOnMouseMove(String) Method

    public void setOnMouseMove(String onmousemove)

Sets the onMouseMove javascript event.

#### Parameters

onmousemove
  - the onMouseMove event.

### setOnMouseOut(String) Method

    public void setOnMouseOut(String onmouseout)

Sets the onMouseOut javascript event.

#### Parameters

onmouseout
  - the onMouseOut event.

### setOnMouseOver(String) Method

    public void setOnMouseOver(String onmouseover)

Sets the onMouseOver javascript event.

#### Parameters

onmouseover
  - the onMouseOver event.

### setOnMouseUp(String) Method

    public void setOnMouseUp(String onmouseup)

Sets the onMouseUp javascript event.

#### Parameters

onmouseup
  - the onMouseUp event.

### setOnReset(String) Method

    public void setOnReset(String onReset)

Sets the onReset javascript event.

#### Parameters

onReset
  - the onReset event.

### setOnSubmit(String) Method

    public void setOnSubmit(String onSubmit)

Sets the onSubmit javascript event.

#### Parameters

onSubmit
  - the onReset event.

### setScope(String) Method

    public void setScope(String scope)

Sets the scope (request or session) under which the associated bean is stored.

#### Parameters

scope
  - the scope.

### setStyle(String) Method

    public void setStyle(String style)

Sets the style of the rendered html tag.

#### Parameters

style
  - the html style.

### setStyleClass(String) Method

    public void setStyleClass(String styleClass)

Sets the style class of the rendered html tag.

#### Parameters

styleClass
  - the html style class.

### setTabindex(String) Method

    public void setTabindex(String tabindex)

Sets the tabIndex of the rendered html tag.

#### Parameters

tabindex
  - the tab index.

### setTagId(String) Method

    public void setTagId(String tagID)

Set the ID of the form.

#### Parameters

tagID
  - the ID.

### setTarget(String) Method

    public void setTarget(String target)

Sets the window target.

#### Parameters

target
  - the window target.

### setType(String) Method

    public void setType(String type)

Sets the Java class name of the bean to be created, if necessary.

#### Parameters

type
  - the class name