Tag form

Define An Input Form

Renders an HTML <form> element whose contents are described by the body content of this tag. The form implicitly interacts with the specified request scope or session scope bean to populate the input fields with the current property values from the bean.

The form bean is located, and created if necessary, based on the form bean specification for the associated ActionMapping.

Tag Information
Tag Classorg.apache.struts.taglib.html.FormTag
TagExtraInfo ClassNone
Body ContentJSP
Display NameNone


The URL to which this form will be submitted. This value is also used to select the ActionMapping we are assumed to be processing, from which we can identify the appropriate form bean and scope. If a value is not provided, the original URI (servletPath) for the request is used.

If you are using extension mapping for selecting the controller servlet, this value should be equal to the path attribute of the corresponding <action> element, optionally followed by the correct extension suffix.

If you are using path mapping to select the controller servlet, this value should be exactly equal to the path attribute of the corresponding <action> element.

acceptCharsetfalsetruejava.lang.StringThe list of character encodings for input data that the server should accept.
Struts 1.2.2

The direction for weak/neutral text for this element.

Struts 1.3.6
disabledfalsetruebooleanSet to true if the Form's input fields should be disabled.
Struts 1.2.7
enctypefalsetruejava.lang.StringThe content encoding to be used to submit this form, if the method is POST. This must be set to "multipart/form-data" if you are using the file tag to enable file upload. If not specified, the browser default (normally "application/x-www-form-urlencoded") is used.
focusfalsetruejava.lang.StringThe field name (among the fields on this form) to which initial focus will be assigned with a JavaScript function. If not specified, no special JavaScript for this purpose will be rendered.
focusIndexfalsetruejava.lang.StringIf the focus field is a field array, such as a radio button group, you can specify the index in the array to receive focus.
Struts 1.1

The language code for this element.

Struts 1.3.6
methodfalsetruejava.lang.StringThe HTTP method that will be used to submit this request (GET, POST). [POST]
onresetfalsetruejava.lang.StringJavaScript event handler executed if the form is reset.
onsubmitfalsetruejava.lang.StringJavaScript event handler executed if the form is submitted.
readonlyfalsetruebooleanSet to true if the Form's input fields should be read only.
Struts 1.2.7
scriptLanguagefalsetruebooleanThe form's focus <script> element will not contain a language attribute when this is set to false. The default is true but this property is ignored in XHMTL mode.
Struts 1.2
stylefalsetruejava.lang.StringCSS styles to be applied to this HTML element.
styleClassfalsetruejava.lang.StringCSS stylesheet class to be applied to this HTML element (renders a "class" attribute).
styleIdfalsetruejava.lang.StringIdentifier to be assigned to this HTML element (renders an "id" attribute).
targetfalsetruejava.lang.StringWindow target to which this form is submitted, such as for use in framed presentations.

No Variables Defined.

Output Generated by Tag Library Documentation Generator. Java, JSP, and JavaServer Pages are trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries. Copyright 2002-4 Sun Microsystems, Inc. 4150 Network Circle Santa Clara, CA 95054, U.S.A. All Rights Reserved.