Struts 2 > Form tag |

Struts 2
Form tag
Edit Page Browse Space Add Page Add News
Added by casey, last edited by Ted Husted on Sep 03, 2006 (view change)

### <ww:form />

An HTML form.

Sample Usages

    <ww:form name="'myForm'" action="'submit.action'">
    ...
    </ww:form>

    <ww:form name="'myForm'" action="'submit'" namespace="'/foo'">
    ...
    </ww:form>

Attributes

Name | Required | Description
--- | --- | ---
name | yes | HTML name attribute
value | no | Data to pass as field value
openTemplate | no | Template to use for the open form tag
action | yes | HTML action attribute
namespace | no | Namespace of action
target | no | HTML target attribute |
method | no | 'GET' or 'POST'
enctype | no | HTML enctype attribute
validate | no | Whether to use client-side validation
cssClass | no | HTML class attribute
cssStyle | no | HTML style attribute
theme | no | Theme to use
template | no | Name of template to use for the closing form tag

Note: The action attribute works in two different ways. The original (and deprecated) format is shown in the first sample usage. The newer format allows you to specify just the action name (as well as a namespace, if there is one) as defined in xwork.xml. This is required if you wish to do any form of Client Side Validation