Struts Framework
Welcome
Home
Kickstart FAQ
User Guide
Resources
Who We Are
Downloads
Binaries
Source Code
Getting Started
Installation
Release Notes
Javadoc
Mailing Lists
Bug Database
Developer Guides
Bean Tags
HTML Tags
Logic Tags
Template Tags
Digester
Utilities
TagLib Documentation
Bean Tags
HTML Tags
Logic Tags
Template Tags
Current Development
Installation (nightly)
Release Notes (nightly)
Javadoc (nightly)
Workflow Proposal
TODO List
DEPRECATED: Form Construction Tags

DEPRECATED: This taglib has been deprecated, use of the struts-html.tld file is recommended in place of it, which contains all of this taglib's functionality. All tags in org.apache.struts.taglib.form have been moved to org.apache.struts.taglib.html. All tags in this file point to the new classes in org.apache.struts.taglib.html. This taglib contains tags used to create struts input forms, as well as other tags generally useful in the creation of HTML-based user interfaces.

Tag NameDescription
baseRender an HTML <base> Element
button Render A Button Input Field
cancel Render a Cancel Button
checkbox Render A Checkbox Input Field
errors Conditionally display a set of accumulated error messages.
file Render A File Select Input Field
form Define An Input Form
hidden Render A Checkbox Input Field
htmlRender an HTML <html> Element
image Renders an input of type "image"
linkRender an HTML anchor or hyperlink
multibox Render A Checkbox Input Field
option Render A Select Option
options Render a Collection of Select Options
password Render A Password Input Field
radio Render A Radio Button Input Field
reset Render A Reset Button Input Field
rewriteRender an URI
select Render A Select Element
submit Render A Submit Button
text Render An Input Field of Type text
textarea Render A Textarea
base - Render an HTML <base> Element

Renders an HTML <base> element with an href attribute pointing to the absolute location of the enclosing JSP page. This tag is valid only when nested inside an HTML <head> element. There are no attributes associated with this tag.

This tag is useful because it allows you to use relative URL references in the page that are calculated based on the URL of the page itself, rather than the URL to which the most recent submit took place (which is where the browser would normally resolve relative references against).

Attribute NameDescription
button - Render A Button Input Field

Renders an HTML <input> element of type button, populated from the specified value or the content of this tag body. This tag is only valid when nested inside a form tag body.

Attribute NameDescription
accesskey The keyboard character used to move focus immediately to this element. [RT Expr]
onblur JavaScript event handler executed when this element loses input focus. [RT Expr]
onchange JavaScript event handler executed when this element loses input focus and its value has changed. [RT Expr]
onclick JavaScript event handler executed when this element receives a mouse click. [RT Expr]
ondblclick JavaScript event handler executed when this element receives a mouse double click. [RT Expr]
onfocus JavaScript event handler executed when this element receives input focus. [RT Expr]
onkeydown JavaScript event handler executed when this element has focus and a key is depressed. [RT Expr]
onkeypress JavaScript event handler executed when this element has focus and a key is depressed and released. [RT Expr]
onkeyup JavaScript event handler executed when this element has focus and a key is released. [RT Expr]
onmousedown JavaScript event handler executed when this element is under the mouse pointer and a mouse button is depressed. [RT Expr]
onmousemove JavaScript event handler executed when this element is under the mouse pointer and the pointer is moved. [RT Expr]
onmouseout JavaScript event handler executed when this element was under the mouse pointer but the pointer was moved outside the element. [RT Expr]
onmouseover JavaScript event handler executed when this element was not under the mouse pointer but the pointer is moved inside the element. [RT Expr]
onmouseup JavaScript event handler executed when this element is under the mouse pointer and a mouse button is released. [RT Expr]
property Name of the request parameter that will be included with this submission, set to the specified value. [Required] [RT Expr]
style CSS styles to be applied to this HTML element. [RT Expr]
styleClass CSS stylesheet class to be applied to this HTML element. [RT Expr]
tabindex The tab order (ascending positive integers) for this element. [RT Expr]
value Value of the label to be placed on this button. This value will also be submitted as the value of the specified request parameter. [Body of this tag (if any), or "Click"] [RT Expr]
cancel - Render a Cancel Button

Renders an HTML <input> element of type submit. This tag is only valid when nested inside a form tag body. Pressing of this submit button causes the action servlet to bypass calling the associated form bean validate() method. The action is called normally.

Attribute NameDescription
accesskey The keyboard character used to move focus immediately to this element. [RT Expr]
onblur JavaScript event handler executed when this element loses input focus. [RT Expr]
onchange JavaScript event handler executed when this element loses input focus and its value has changed. [RT Expr]
onclick JavaScript event handler executed when this element receives a mouse click. [RT Expr]
ondblclick JavaScript event handler executed when this element receives a mouse double click. [RT Expr]
onfocus JavaScript event handler executed when this element receives input focus. [RT Expr]
onkeydown JavaScript event handler executed when this element has focus and a key is depressed. [RT Expr]
onkeypress JavaScript event handler executed when this element has focus and a key is depressed and released. [RT Expr]
onkeyup JavaScript event handler executed when this element has focus and a key is released. [RT Expr]
onmousedown JavaScript event handler executed when this element is under the mouse pointer and a mouse button is depressed. [RT Expr]
onmousemove JavaScript event handler executed when this element is under the mouse pointer and the pointer is moved. [RT Expr]
onmouseout JavaScript event handler executed when this element was under the mouse pointer but the pointer was moved outside the element. [RT Expr]
onmouseover JavaScript event handler executed when this element was not under the mouse pointer but the pointer is moved inside the element. [RT Expr]
onmouseup JavaScript event handler executed when this element is under the mouse pointer and a mouse button is released. [RT Expr]
property Name of the request parameter that will be included with this submission, set to the specified value. [RT Expr]
style CSS styles to be applied to this HTML element. [RT Expr]
styleClass CSS stylesheet class to be applied to this HTML element. [RT Expr]
tabindex The tab order (ascending positive integers) for this element. [RT Expr]
value Value of the label to be placed on this button. This value will also be submitted as the value of the specified request parameter. [Body of this tag (if any), or "Cancel"] [RT Expr]
checkbox - Render A Checkbox Input Field

Renders an HTML <input> element of type checkbox, populated from the specified value or the specified property of the bean associated with our current form. This tag is only valid when nested inside a form tag body.

Attribute NameDescription
accesskey The keyboard character used to move focus immediately to this element. [RT Expr]
name The attribute name of the bean whose properties are consulted when rendering the current value of this input field. If not specified, the bean associated with the form tag we are nested within is utilized. [RT Expr]
onblur JavaScript event handler executed when this element loses input focus. [RT Expr]
onchange JavaScript event handler executed when this element loses input focus and its value has changed. [RT Expr]
onclick JavaScript event handler executed when this element receives a mouse click. [RT Expr]
ondblclick JavaScript event handler executed when this element receives a mouse double click. [RT Expr]
onfocus JavaScript event handler executed when this element receives input focus. [RT Expr]
onkeydown JavaScript event handler executed when this element has focus and a key is depressed. [RT Expr]
onkeypress JavaScript event handler executed when this element has focus and a key is depressed and released. [RT Expr]
onkeyup JavaScript event handler executed when this element has focus and a key is released. [RT Expr]
onmousedown JavaScript event handler executed when this element is under the mouse pointer and a mouse button is depressed. [RT Expr]
onmousemove JavaScript event handler executed when this element is under the mouse pointer and the pointer is moved. [RT Expr]
onmouseout JavaScript event handler executed when this element was under the mouse pointer but the pointer was moved outside the element. [RT Expr]
onmouseover JavaScript event handler executed when this element was not under the mouse pointer but the pointer is moved inside the element. [RT Expr]
onmouseup JavaScript event handler executed when this element is under the mouse pointer and a mouse button is released. [RT Expr]
property Name of the request parameter that will be included with this submission, set to the specified value. [Required] [RT Expr]
style CSS styles to be applied to this HTML element. [RT Expr]
styleClass CSS stylesheet class to be applied to this HTML element. [RT Expr]
tabindex The tab order (ascending positive integers) for this element. [RT Expr]
value Value of the label to be placed on this button. This value will also be submitted as the value of the specified request parameter. [Body of this tag (if any), or "Cancel"] [RT Expr]
errors - Conditionally display a set of accumulated error messages.

Displays a set of error messages prepared by a business logic component and stored as an ActionErrors object, a String, or a String array in request scope. If such a bean is not found, nothing will be rendered.

In order to use this tag successfully, you must have defined an application scope MessageResources bean under the default attribute name, with at least the following message keys:

  • errors.header - Text that will be rendered before the error messages list. Typically, this message text will end with <ul> to start the error messages list.
  • errors.footer - Text that will be rendered after the error messages list. Typically, this message text will begin with </ul> to end the error messages list.
Attribute NameDescription
name Name of the request scope bean under which our error messages have been stored. If not present, the name specified by the Action.ERROR_KEY constant string will be used. [RT Expr]
file - Render A File Select Input Field

Renders an HTML <input> element of type file, defaulting to the specified value or the specified property of the bean associated with our current form. This tag is only valid when nested inside a form tag body.

Attribute NameDescription
accesskey The keyboard character used to move focus immediately to this element. [RT Expr]
accept Comma-delimited set of content types that the server you submit to knows how to process. This list can be used by the client browser to limit the set of file options that is made available for selection. If not specified, no content type list will be sent. [RT Expr]
maxlength Maximum number of input characters to accept. [No limit] [RT Expr]
name The attribute name of the bean whose properties are consulted when rendering the current value of this input field. If not specified, the bean associated with the form tag we are nested within is utilized. [RT Expr]
onblur JavaScript event handler executed when this element loses input focus. [RT Expr]
onchange JavaScript event handler executed when this element loses input focus and its value has changed. [RT Expr]
onclick JavaScript event handler executed when this element receives a mouse click. [RT Expr]
ondblclick JavaScript event handler executed when this element receives a mouse double click. [RT Expr]
onfocus JavaScript event handler executed when this element receives input focus. [RT Expr]
onkeydown JavaScript event handler executed when this element has focus and a key is depressed. [RT Expr]
onkeypress JavaScript event handler executed when this element has focus and a key is depressed and released. [RT Expr]
onkeyup JavaScript event handler executed when this element has focus and a key is released. [RT Expr]
onmousedown JavaScript event handler executed when this element is under the mouse pointer and a mouse button is depressed. [RT Expr]
onmousemove JavaScript event handler executed when this element is under the mouse pointer and the pointer is moved. [RT Expr]
onmouseout JavaScript event handler executed when this element was under the mouse pointer but the pointer was moved outside the element. [RT Expr]
onmouseover JavaScript event handler executed when this element was not under the mouse pointer but the pointer is moved inside the element. [RT Expr]
onmouseup JavaScript event handler executed when this element is under the mouse pointer and a mouse button is released. [RT Expr]
property Name of the request parameter that will be included with this submission, set to the specified value. [Required] [RT Expr]
style CSS styles to be applied to this HTML element. [RT Expr]
styleClass CSS stylesheet class to be applied to this HTML element. [RT Expr]
tabindex The tab order (ascending positive integers) for this element. [RT Expr]
value Value of the label to be placed on this button. This value will also be submitted as the value of the specified request parameter. [Body of this tag (if any), or "Cancel"] [RT Expr]
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.

Attribute NameDescription
action The URL to which this form will be submitted. Typically, this will match a mapping for the ActionServlet managing this application. URL rewriting will automatically be performed on this URL, to maintain session state in the absence of cookies. [Form will be submitted to this page itself] [RT Expr]
enctype The 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. [RT Expr]
focus The 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. [RT Expr]
method The HTTP method that will be used to submit this request (GET, POST). [POST] [RT Expr]
name Name of the request scope or session scope bean (as defined by the scope attribute) whose properties will be used to populate input field values. If no such bean is found, a new bean will be created (and added to the appropriate scope), using the Java class name specified by the type attribute. [RT Expr]
onreset JavaScript event handler executed if the form is reset. [RT Expr]
onsubmit JavaScript event handler executed if the form is submitted. [RT Expr]
scope JSP scope within which the associated bean will be accessed or created (request, session). [session] [RT Expr]
style CSS styles to be applied to this HTML element. [RT Expr]
styleClass CSS stylesheet class to be applied to this HTML element. [RT Expr]
target Window target to which this form is submitted, such as for use in framed presentations. [RT Expr]
type Fully qualified Java class name of the bean to be created if no bean is found for the specified name and scope. To be used successfully with the Struts ActionServlet, this class must implement the org.apache.struts.action.ActionForm interface. [Runtime error if bean creation is attempted] [RT Expr]
hidden - Render A Checkbox Input Field

Renders an HTML <input> element of type hidden, populated from the specified value or the specified property of the bean associated with our current form. This tag is only valid when nested inside a form tag body.

Attribute NameDescription
name The attribute name of the bean whose properties are consulted when rendering the current value of this input field. If not specified, the bean associated with the form tag we are nested within is utilized. [RT Expr]
property Name of this input field, and the name of the corresponding bean property if value is not specified. The corresponding bean property (if any) must be of type String. [Required] [RT Expr]
value Value to which this field should be initialized. [Use the corresponding bean property value] [RT Expr]
html - Render an HTML <html> Element

Renders an HTML <html> element with language attributes extracted from the user's current Locale object, if there is one.

Attribute NameDescription
locale

Set to true in order to record a Locale based on the current request's Accept-Language header (if any) if none has currently been set.

[RT Expr]
xhtml

Set to true in order to render an xml:lang attribute on the generated html element.

[RT Expr]
image - Renders an input of type "image"
This tag renders an input of type "image". Use the "src" attribute in conjunction with a non-null "isKey" attribute to retrieve a property value from a resource bundle. Use the "path" attribute to specify a direct path to the image. See info on the "property" attribute if you would like to obtain the coordinates of the mouse click submitted with the request.
Attribute NameDescription
locale The locale to use to retrieve the key specified by "src". [RT Expr]
bundle The servlet context attribute key for the MessageResources instance to use. [RT Expr]
accesskey [RT Expr]
onblur [RT Expr]
onchange [RT Expr]
onclick [RT Expr]
ondblclick [RT Expr]
onfocus [RT Expr]
onkeydown [RT Expr]
onkeypress [RT Expr]
onkeyup [RT Expr]
onmousedown [RT Expr]
onmousemove [RT Expr]
onmouseout [RT Expr]
onmouseover [RT Expr]
onmouseup [RT Expr]
property The name of this image tag. The parameter names for the request will appear as "property.x" and "property.y", the x and y representing the coordinates of the mouse click for the image. A way of retrieving these values through a form bean is to define getX(), getY(), setX(), and setY() methods, and specify your propery as a blank string (property=""). [RT Expr]
src The "src" attribute of the input tag, or if "isKey" is not null, the key of the bundle value to use for this attribute. [Required] [RT Expr]
style [RT Expr]
styleClass [RT Expr]
tabindex [RT Expr]
value [RT Expr]
path The path of image for image button. [RT Expr]
isKey Whether or not the "src" attribute represents a ResourceBundle key. [RT Expr]
link - Render an HTML anchor or hyperlink

Renders an HTML <a> element as an anchor definition (if "linkName" is specified) or as a hyperlink to the specified URL. URL rewriting will be applied automatically, to maintain session state in the absence of cookies. The content displayed for this hyperlink will be taken from the body of this tag.

The base URL for this hyperlink is calculated based on which of the following attributes you specify (you must specify exactly one of them):

  • forward - Use the value of this attribute as the name of a global ActionForward to be looked up, and use the context-relative URI found there.
  • href - Use the value of this attribute unchanged.
  • page - Use the value of this attribute as a context-relative URI, and generate a server-relative URI by including the context path.

Normally, the hyperlink you specify with one of the attributes described in the previous paragraph will be left unchanged (other than URL rewriting if necessary). However, there are two ways you can append one or more dynamically defined query parameters to the hyperlink -- specify a single parameter with the paramId attribute (and its associated attributes to select the value), or specify the name (and optional property) attributes to select a java.util.Map bean that contains one or more parameter ids and corresponding values.

To specify a single parameter, use the paramId attribute to define the name of the request parameter to be submitted. To specify the corresponding value, use one of the following approaches:

  • Specify only the paramName attribute - The named JSP bean (optionally scoped by the value of the paramScope attribute) must identify a value that can be converted to a String.
  • Specify both the paramName and paramProperty attributes - The specified property getter method will be called on the JSP bean identified by the paramName (and optional paramScope) attributes, in order to select a value that can be converted to a String.

If you prefer to specify a java.util.Map that contains all of the request parameters to be added to the hyperlink, use one of the following techniques:

  • Specify only the name attribute - The named JSP bean (optionally scoped by the value of the scope attribute) must identify a java.util.Map containing the parameters.
  • Specify both name and property attributes - The specified property getter method will be called on the bean identified by the name (and optional scope) attributes, in order to return the java.util.Map containing the parameters.

As the Map is processed, the keys are assumed to be the names of query parameters to be appended to the hyperlink. The value associated with each key must be either a String or a String array representing the parameter value(s). If a String array is specified, more than one value for the same query parameter name will be created.

Attribute NameDescription
accesskey

The keyboard character used to move focus immediately to this element.

[RT Expr]
forward

Logical name of a global ActionForward that contains the actual content-relative URI of the destination of this transfer. This hyperlink may be dynamically modified by the inclusion of query parameters, as described in the tag description. You must specify exactly one of the forward attribute, the href attribute, the linkName attribute, or the page attribute.

[RT Expr]
href

The URL to which this hyperlink will transfer control if activated. This hyperlink may be dynamically modified by the inclusion of query parameters, as described in the tag description. You must specify exactly one of the forward attribute, the href attribute, the linkName attribute, or the page attribute.

[RT Expr]
linkName

The anchor name to be defined within this page, so that you can reference it with intra-page hyperlinks. In other words, the value specified here will render a "name" element in the generated anchor tag.

[RT Expr]
name

The name of a JSP bean that contains a Map representing the query parameters (if property is not specified), or a JSP bean whose property getter is called to return a Map (if property is specified).

[RT Expr]
onblur

JavaScript event handler that is executed when this element loses input focus.

[RT Expr]
onclick

JavaScript event handler that is executed when this element receives a mouse click.

[RT Expr]
ondblclick

JavaScript event handler that is executed when this element receives a mouse double click.

[RT Expr]
onfocus

JavaScript event handler that is executed when this element receives input focus.

[RT Expr]
onkeydown

JavaScript event handler that is executed when this element receives a key down event.

[RT Expr]
onkeypress

JavaScript event handler that is executed when this element receives a key press event.

[RT Expr]
onkeyup

JavaScript event handler that is executed when this element receives a key up event.

[RT Expr]
onmousedown

JavaScript event handler that is executed when this element receives a mouse down event.

[RT Expr]
onmousemove

JavaScript event handler that is executed when this element receives a mouse move event.

[RT Expr]
onmouseout

JavaScript event handler that is executed when this element receives a mouse out event.

[RT Expr]
onmouseover

JavaScript event handler that is executed when this element receives a mouse over event.

[RT Expr]
onmouseup

JavaScript event handler that is executed when this element receives a mouse up event.

[RT Expr]
page

The context-relative path (beginning with a "/" character) to which this hyperlink will transfer control if activated. This hyperlink may be dynamically modified by the inclusion of query parameters, as described in the tag description. You must specify exactly one of the forward attribute, the href attribute, the linkName attribute, or the page attribute.

[RT Expr]
paramId

The name of the request parameter that will be dynamically added to the generated hyperlink. The corresponding value is defined by the paramName and (optional) paramProperty attributes, optionally scoped by the paramScope attributel

[RT Expr]
paramName

The name of a JSP bean that is a String containing the value for the request parameter named by paramId (if paramProperty is not specified), or a JSP bean whose property getter is called to return a String (if paramProperty is specified). The JSP bean is constrained to the bean scope specified by the paramScope property, if it is specified.

[RT Expr]
paramProperty

The name of a property of the bean specified by the paramName attribute, whose return value must be a String containing the value of the request parameter (named by the paramId attribute) that will be dynamically added to this hyperlink.

[RT Expr]
paramScope

The scope within which to search for the bean specified by the paramName attribute. If not specified, all scopes are searched.

[RT Expr]
property

The name of a property of the bean specified by the name attribute, whose return value must be a java.util.Map containing the query parameters to be added to the hyperlink. You must specify the name attribute if you specify this attribute.

[RT Expr]
scope

The scope within which to search for the bean specified by the name attribute. If not specified, all scopes are searched.

[RT Expr]
style

CSS styles to be applied to this element.

[RT Expr]
styleClass

CSS stylesheet class to be applied to this element.

[RT Expr]
tabindex

The tab order (ascending positive integers) for this element.

[RT Expr]
target

The window target in which the resource requested by this hyperlink will be displayed, for example in a framed presentation.

[RT Expr]
multibox - Render A Checkbox Input Field

Renders an HTML <input> element of type checkbox, whose "checked" status is initialized based on whether the specified value matches one of the elements of the underlying property's array of current values. This element is useful when you have large numbers of checkboxes, and prefer to combine the values into a single array-valued property instead of multiple boolean properties. This tag is only valid when nested inside a form tag body.

Attribute NameDescription
accesskey The keyboard character used to move focus immediately to this element. [RT Expr]
name The attribute name of the bean whose properties are consulted when rendering the current value of this input field. If not specified, the bean associated with the form tag we are nested within is utilized. [RT Expr]
onblur JavaScript event handler executed when this element loses input focus. [RT Expr]
onchange JavaScript event handler executed when this element loses input focus and its value has changed. [RT Expr]
onclick JavaScript event handler executed when this element receives a mouse click. [RT Expr]
ondblclick JavaScript event handler executed when this element receives a mouse double click. [RT Expr]
onfocus JavaScript event handler executed when this element receives input focus. [RT Expr]
onkeydown JavaScript event handler executed when this element has focus and a key is depressed. [RT Expr]
onkeypress JavaScript event handler executed when this element has focus and a key is depressed and released. [RT Expr]
onkeyup JavaScript event handler executed when this element has focus and a key is released. [RT Expr]
onmousedown JavaScript event handler executed when this element is under the mouse pointer and a mouse button is depressed. [RT Expr]
onmousemove JavaScript event handler executed when this element is under the mouse pointer and the pointer is moved. [RT Expr]
onmouseout JavaScript event handler executed when this element was under the mouse pointer but the pointer was moved outside the element. [RT Expr]
onmouseover JavaScript event handler executed when this element was not under the mouse pointer but the pointer is moved inside the element. [RT Expr]
onmouseup JavaScript event handler executed when this element is under the mouse pointer and a mouse button is released. [RT Expr]
property Name of the request parameter that will be included with this submission, set to the specified value. [Required] [RT Expr]
style CSS styles to be applied to this HTML element. [RT Expr]
styleClass CSS stylesheet class to be applied to this HTML element. [RT Expr]
tabindex The tab order (ascending positive integers) for this element. [RT Expr]
value Value of the label to be placed on this button. This value will also be submitted as the value of the specified request parameter. [Body of this tag (if any), or "Cancel"] [RT Expr]
option - Render A Select Option

Renders an HTML <option> element, representing one of the choices for a <select> element. The text displayed to the user comes from the body of this tag. If the value of the corresponding bean property matches the specified value, this option will be marked selected. This tag is only valid when nested inside a select tag body.

Attribute NameDescription
value Value to be submitted for this field if this option is selected by the user. [Required] [RT Expr]
options - Render a Collection of Select Options

Renders a set of HTML <option> elements, representing possible choices for a <select> element. This tag can be used multiple times within a single <form:select> element, either in conjunction with or instead of one or more <form:option> elements.

This tag operates in one of two major modes, depending on whether or not the collection attribute is specified. If the collection attribute is included, the following rules apply:

  • The collection attribute is interpreted as the name of a JSP bean, in some scope, that itself represents a collection of individual beans, one per option value to be rendered.
  • The property attribute is interpreted as the name of a property of the individual beans included in the collection, and is used to retrieve the value that will be returned to the server if this option is selected.
  • The labelProperty attribute is interpreted as the name of a property of the individual beans included in the collection, and is used to retrieve the label that will be displayed to the user for this option. If the labelProperty attribute is not specified, the property named by the property attribute will be used to select both the value returned to the server and the label displayed to the user for this option.

If the collection attribute is not specified, the rules described in the remainder of this section apply.

The collection of values actually selected depends on the presence or absence of the name and property attributes. The following combinations are allowed:

  • Only name is specified - The value of this attribute is the name of a JSP bean in some scope that is the collection.
  • Only property is specified - The value of this attribute is the name of a property of the ActionForm bean associated with our form, which will return the collection.
  • Both name and property are specified - The value of the name attribute identifies a JSP bean in some scope. The value of the property attribute is the name of some property of that bean which will return the collection.

The collection of labels displayed to the user can be the same as the option values themselves, or can be different, depending on the presence or absence of the labelName and labelProperty attributes. If this feature is used, the collection of labels must contain the same number of elements as the corresponding collection of values. The following combinations are allowed:

  • Neither labelName nor labelProperty is specified - The labels will be the same as the option values themselves.
  • Only labelName is specified - The value of this attribute is the name of a JSP bean in some scope that is the collection.
  • Only labelProperty is specified - The value of this attribute is the name of a property of the ActionForm bean associated with our form, which will return the collection.
  • Both labelName and labelProperty are specified - The value of the labelName attribute identifies a JSP bean in some scope. The value of the labelProperty attribute is the name of some property of that bean which will return the collection.
Attribute NameDescription
collection Name of the JSP bean (in some scope) which is itself a Collection of other beans, each of which has properties named by the "property" and "labelProperty" attributes that are used to retrieve the value and label for each option, respectively. [RT Expr]
labelName Name of the JSP bean (in some scope) containing the collection of labels to be displayed to the user for these options. [RT Expr]
labelProperty Property of the form bean, or the bean specified by the labelName attribute, that will return the collection of labels to be displayed to the user for these options. [RT Expr]
name Name of the JSP bean (in some scope) containing the collection of values to be returned to the server for these options. If not specified, the form bean associated with our form is assumed. [RT Expr]
property Property of the form bean, or the bean specified by the name attribute, that will return the collection of values to returned to the server for these options. [RT Expr]
password - Render A Password Input Field
Renders an HTML <input> element of type password, populated from the specified value or the specified property of the bean associated with our current form. This tag is only valid when nested inside a form tag body.
Attribute NameDescription
accesskey The keyboard character used to move focus immediately to this element. [RT Expr]
maxlength Maximum number of input characters to accept. [No limit] [RT Expr]
name The attribute name of the bean whose properties are consulted when rendering the current value of this input field. If not specified, the bean associated with the form tag we are nested within is utilized. [RT Expr]
onblur JavaScript event handler executed when this element loses input focus. [RT Expr]
onchange JavaScript event handler executed when this element loses input focus and its value has changed. [RT Expr]
onclick JavaScript event handler executed when this element receives a mouse click. [RT Expr]
ondblclick JavaScript event handler executed when this element receives a mouse double click. [RT Expr]
onfocus JavaScript event handler executed when this element receives input focus. [RT Expr]
onkeydown JavaScript event handler executed when this element has focus and a key is depressed. [RT Expr]
onkeypress JavaScript event handler executed when this element has focus and a key is depressed and released. [RT Expr]
onkeyup JavaScript event handler executed when this element has focus and a key is released. [RT Expr]
onmousedown JavaScript event handler executed when this element is under the mouse pointer and a mouse button is depressed. [RT Expr]
onmousemove JavaScript event handler executed when this element is under the mouse pointer and the pointer is moved. [RT Expr]
onmouseout JavaScript event handler executed when this element was under the mouse pointer but the pointer was moved outside the element. [RT Expr]
onmouseover JavaScript event handler executed when this element was not under the mouse pointer but the pointer is moved inside the element. [RT Expr]
onmouseup JavaScript event handler executed when this element is under the mouse pointer and a mouse button is released. [RT Expr]
property Name of the request parameter that will be included with this submission, set to the specified value. [Required] [RT Expr]
style CSS styles to be applied to this HTML element. [RT Expr]
styleClass CSS stylesheet class to be applied to this HTML element. [RT Expr]
size Number of character positions to allocate. [Browser default] [RT Expr]
tabindex The tab order (ascending positive integers) for this element. [RT Expr]
value Value of the label to be placed on this button. This value will also be submitted as the value of the specified request parameter. [Body of this tag (if any), or "Cancel"] [RT Expr]
radio - Render A Radio Button Input Field
Renders an HTML <input> element of type radio, populated from the specified property of the bean associated with our current form. This tag is only valid when nested inside a form tag body.
Attribute NameDescription
accesskey The keyboard character used to move focus immediately to this element. [RT Expr]
name The attribute name of the bean whose properties are consulted when rendering the current value of this input field. If not specified, the bean associated with the form tag we are nested within is utilized. [RT Expr]
onblur JavaScript event handler executed when this element loses input focus. [RT Expr]
onchange JavaScript event handler executed when this element loses input focus and its value has changed. [RT Expr]
onclick JavaScript event handler executed when this element receives a mouse click. [RT Expr]
ondblclick JavaScript event handler executed when this element receives a mouse double click. [RT Expr]
onfocus JavaScript event handler executed when this element receives input focus. [RT Expr]
onkeydown JavaScript event handler executed when this element has focus and a key is depressed. [RT Expr]
onkeypress JavaScript event handler executed when this element has focus and a key is depressed and released. [RT Expr]
onkeyup JavaScript event handler executed when this element has focus and a key is released. [RT Expr]
property The corresponding bean property for this radio tag. [Required] [RT Expr]
onmousedown JavaScript event handler executed when this element is under the mouse pointer and a mouse button is depressed. [RT Expr]
value The value of the radio tag. [Required] [RT Expr]
reset - Render A Reset Button Input Field
Renders an HTML <input> element of type reset.
Attribute NameDescription
accesskey The keyboard character used to move focus immediately to this element. [RT Expr]
onblur JavaScript event handler executed when this element loses input focus. [RT Expr]
onchange JavaScript event handler executed when this element loses input focus and its value has changed. [RT Expr]
onclick JavaScript event handler executed when this element receives a mouse click. [RT Expr]
ondblclick JavaScript event handler executed when this element receives a mouse double click. [RT Expr]
onfocus JavaScript event handler executed when this element receives input focus. [RT Expr]
onkeydown JavaScript event handler executed when this element has focus and a key is depressed. [RT Expr]
onkeypress JavaScript event handler executed when this element has focus and a key is depressed and released. [RT Expr]
onkeyup JavaScript event handler executed when this element has focus and a key is released. [RT Expr]
onmousedown JavaScript event handler executed when this element is under the mouse pointer and a mouse button is depressed. [RT Expr]
onmousemove JavaScript event handler executed when this element is under the mouse pointer and the pointer is moved. [RT Expr]
onmouseout JavaScript event handler executed when this element was under the mouse pointer but the pointer was moved outside the element. [RT Expr]
onmouseover JavaScript event handler executed when this element was not under the mouse pointer but the pointer is moved inside the element. [RT Expr]
onmouseup JavaScript event handler executed when this element is under the mouse pointer and a mouse button is released. [RT Expr]
style CSS styles to be applied to this HTML element. [RT Expr]
styleClass CSS stylesheet class to be applied to this HTML element. [RT Expr]
tabindex The tab order (ascending positive integers) for this element. [RT Expr]
rewrite - Render an URI

Renders a request URI based on exactly the same rules as the link tag does, but without creating the <a> hyperlink. This value is useful when you want to generate a string constant for use by a JavaScript procedure.

Attribute NameDescription
forward

Logical name of a global ActionForward that contains the actual content-relative URI of the destination of this transfer. This hyperlink may be dynamically modified by the inclusion of query parameters, as described in the tag description. You must specify exactly one of the forward attribute, the href attribute, or the page attribute.

[RT Expr]
href

The URL to which this hyperlink will transfer control if activated. This hyperlink may be dynamically modified by the inclusion of query parameters, as described in the tag description. You must specify exactly one of the forward attribute, the href attribute, or the page attribute.

[RT Expr]
page

The context-relative path (beginning with a "/" character) to which this hyperlink will transfer control if activated. This hyperlink may be dynamically modified by the inclusion of query parameters, as described in the tag description. You must specify exactly one of the forward attribute, the href attribute, or the page attribute.

[RT Expr]
name

The name of a JSP bean that contains a Map representing the query parameters (if property is not specified), or a JSP bean whose property getter is called to return a Map (if property is specified).

[RT Expr]
property

The name of a property of the bean specified by the name attribute, whose return value must be a java.util.Map containing the query parameters to be added to the hyperlink. You must specify the name attribute if you specify this attribute.

[RT Expr]
scope

The scope within which to search for the bean specified by the name attribute. If not specified, all scopes are searched.

[RT Expr]
select - Render A Select Element
Custom tag that represents an HTML select element, associated with a bean property specified by our attributes. This tag must be nested inside a form tag.
Attribute NameDescription
accesskey The keyboard character used to move focus immediately to this element. [RT Expr]
multiple If set to any arbitrary value, the rendered select element will support multiple selections. [RT Expr]
name The attribute name to use in determining which option should be pre-selected when rendering this input field. If not specified, the bean associated with the form tag we are nested within is utilized. [RT Expr]
onblur JavaScript event handler executed when this element loses input focus. [RT Expr]
onchange JavaScript event handler executed when this element loses input focus and its value has changed. [RT Expr]
onclick JavaScript event handler executed when this element receives a mouse click. [RT Expr]
ondblclick JavaScript event handler executed when this element receives a mouse double click. [RT Expr]
onfocus JavaScript event handler executed when this element receives input focus. [RT Expr]
onkeydown JavaScript event handler executed when this element has focus and a key is depressed. [RT Expr]
onkeypress JavaScript event handler executed when this element has focus and a key is depressed and released. [RT Expr]
onkeyup JavaScript event handler executed when this element has focus and a key is released. [RT Expr]
onmousedown JavaScript event handler executed when this element is under the mouse pointer and a mouse button is depressed. [RT Expr]
onmousemove JavaScript event handler executed when this element is under the mouse pointer and the pointer is moved. [RT Expr]
onmouseout JavaScript event handler executed when this element was under the mouse pointer but the pointer was moved outside the element. [RT Expr]
onmouseover JavaScript event handler executed when this element was not under the mouse pointer but the pointer is moved inside the element. [RT Expr]
onmouseup JavaScript event handler executed when this element is under the mouse pointer and a mouse button is released. [RT Expr]
property Name of the request parameter that will be included with this submission, set to the specified value. [Required] [RT Expr]
style CSS styles to be applied to this HTML element. [RT Expr]
styleClass CSS stylesheet class to be applied to this HTML element. [RT Expr]
tabindex The tab order (ascending positive integers) for this element. [RT Expr]
size The number of available options displayed at one time. [RT Expr]
value The value to compare with for marking an option selected. [RT Expr]
submit - Render A Submit Button
Render an input button of type submit.
Attribute NameDescription
accesskey The keyboard character used to move focus immediately to this element. [RT Expr]
onblur JavaScript event handler executed when this element loses input focus. [RT Expr]
onchange JavaScript event handler executed when this element loses input focus and its value has changed. [RT Expr]
onclick JavaScript event handler executed when this element receives a mouse click. [RT Expr]
ondblclick JavaScript event handler executed when this element receives a mouse double click. [RT Expr]
onfocus JavaScript event handler executed when this element receives input focus. [RT Expr]
onkeydown JavaScript event handler executed when this element has focus and a key is depressed. [RT Expr]
onkeypress JavaScript event handler executed when this element has focus and a key is depressed and released. [RT Expr]
onkeyup JavaScript event handler executed when this element has focus and a key is released. [RT Expr]
onmousedown JavaScript event handler executed when this element is under the mouse pointer and a mouse button is depressed. [RT Expr]
onmousemove JavaScript event handler executed when this element is under the mouse pointer and the pointer is moved. [RT Expr]
onmouseout JavaScript event handler executed when this element was under the mouse pointer but the pointer was moved outside the element. [RT Expr]
onmouseover JavaScript event handler executed when this element was not under the mouse pointer but the pointer is moved inside the element. [RT Expr]
onmouseup JavaScript event handler executed when this element is under the mouse pointer and a mouse button is released. [RT Expr]
property Name of the request parameter that will be included with this submission, set to the specified value. [RT Expr]
style CSS styles to be applied to this HTML element. [RT Expr]
styleClass CSS stylesheet class to be applied to this HTML element. [RT Expr]
tabindex The tab order (ascending positive integers) for this element. [RT Expr]
value The value of the button label. [RT Expr]
text - Render An Input Field of Type text
Render an input button of type text.
Attribute NameDescription
accesskey The keyboard character used to move focus immediately to this element. [RT Expr]
name The attribute name of the bean whose properties are consulted when rendering the current value of this input field. If not specified, the bean associated with the form tag we are nested within is utilized. [RT Expr]
property Name of this input field, and the name of the corresponding bean property if value is not specified. The corresponding bean property (if any) must be of type String. [Required] [RT Expr]
value Value to which this field should be initialized. [Use the corresponding bean property value] [RT Expr]
maxlength Maximum number of input characters to accept. [No limit] [RT Expr]
size Number of character positions to allocate. [Browser default] [RT Expr]
onblur JavaScript event handler executed when this element loses input focus. [RT Expr]
onchange JavaScript event handler executed when this element loses input focus and its value has changed. [RT Expr]
onclick JavaScript event handler executed when this element receives a mouse click. [RT Expr]
ondblclick JavaScript event handler executed when this element receives a mouse double click. [RT Expr]
onfocus JavaScript event handler executed when this element receives input focus. [RT Expr]
onkeydown JavaScript event handler executed when this element has focus and a key is depressed. [RT Expr]
onkeypress JavaScript event handler executed when this element has focus and a key is depressed and released. [RT Expr]
onkeyup JavaScript event handler executed when this element has focus and a key is released. [RT Expr]
onmousedown JavaScript event handler executed when this element is under the mouse pointer and a mouse button is depressed. [RT Expr]
onmousemove JavaScript event handler executed when this element is under the mouse pointer and the pointer is moved. [RT Expr]
onmouseout JavaScript event handler executed when this element was under the mouse pointer but the pointer was moved outside the element. [RT Expr]
onmouseover JavaScript event handler executed when this element was not under the mouse pointer but the pointer is moved inside the element. [RT Expr]
onmouseup JavaScript event handler executed when this element is under the mouse pointer and a mouse button is released. [RT Expr]
style CSS styles to be applied to this HTML element. [RT Expr]
styleClass CSS stylesheet class to be applied to this HTML element. [RT Expr]
tabindex The tab order (ascending positive integers) for this element. [RT Expr]
textarea - Render A Textarea
Render a textarea element.
Attribute NameDescription
accesskey The keyboard character used to move focus immediately to this element. [RT Expr]
cols The number of columns to display. [RT Expr]
name The attribute name of the bean whose properties are consulted when rendering the current value of this input field. If not specified, the bean associated with the form tag we are nested within is utilized. [RT Expr]
property Name of this input field, and the name of the corresponding bean property if value is not specified. The corresponding bean property (if any) must be of type String. [Required] [RT Expr]
value Value to which this field should be initialized. [Use the corresponding bean property value] [RT Expr]
onblur JavaScript event handler executed when this element loses input focus. [RT Expr]
onchange JavaScript event handler executed when this element loses input focus and its value has changed. [RT Expr]
onclick JavaScript event handler executed when this element receives a mouse click. [RT Expr]
ondblclick JavaScript event handler executed when this element receives a mouse double click. [RT Expr]
onfocus JavaScript event handler executed when this element receives input focus. [RT Expr]
onkeydown JavaScript event handler executed when this element has focus and a key is depressed. [RT Expr]
onkeypress JavaScript event handler executed when this element has focus and a key is depressed and released. [RT Expr]
onkeyup JavaScript event handler executed when this element has focus and a key is released. [RT Expr]
onmousedown JavaScript event handler executed when this element is under the mouse pointer and a mouse button is depressed. [RT Expr]
onmousemove JavaScript event handler executed when this element is under the mouse pointer and the pointer is moved. [RT Expr]
onmouseout JavaScript event handler executed when this element was under the mouse pointer but the pointer was moved outside the element. [RT Expr]
onmouseover JavaScript event handler executed when this element was not under the mouse pointer but the pointer is moved inside the element. [RT Expr]
onmouseup JavaScript event handler executed when this element is under the mouse pointer and a mouse button is released. [RT Expr]
rows The number of rows to display. [RT Expr]
style CSS styles to be applied to this HTML element. [RT Expr]
styleClass CSS stylesheet class to be applied to this HTML element. [RT Expr]
tabindex The tab order (ascending positive integers) for this element. [RT Expr]

Copyright (c) 2000-2002, Apache Software Foundation