Introduction

This document contains reference information about each of the tags defined in the Struts custom tag library. For each tag, the following information is presented:

NOTE: ALL OF THE INFORMATION IN THIS DOCUMENT IS DEPRECATED, AND IS AVAILABLE IN STRUTS 1.0 ONLY TO ASSIST IN THE CONVERSION OF APPLICATIONS BASED ON STRUTS 0.5 TO THE STRUTS 1.0 RELEASE. THIS LIBRARY WILL BE REMOVED IN FUTURE VERSIONS OF STRUTS.

base - Render A Base Html Tag

Renders an HTML <base> element with an href attribute pointing to the absolute location of the enclosing JSP page. This tag is only valid when nested inside a head tag body. The presence of this tag allows the browser to resolve relative URL's to images, CSS stylesheets and other resources in a manner independent of the URL used to call the ActionServlet. There are no attributes associated with this tag.

Top

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 Description
accessKey The keyboard character used to move focus immediately to this element.
onBlur JavaScript event handler executed when this element loses input focus.
onChange JavaScript event handler executed when this element loses input focus and its value has changed.
onClick JavaScript event handler executed when this element receives a mouse click.
onDblClick JavaScript event handler executed when this element receives a mouse double click.
onFocus JavaScript event handler executed when this element receives input focus.
onKeyDown JavaScript event handler executed when this element has focus and a key is depressed.
onKeyPress JavaScript event handler executed when this element has focus and a key is depressed and released.
onKeyUp JavaScript event handler executed when this element has focus and a key is released.
onMouseDown JavaScript event handler executed when this element is under the mouse pointer and a mouse button is depressed.
onMouseMove JavaScript event handler executed when this element is under the mouse pointer and the pointer is moved.
onMouseOut JavaScript event handler executed when this element was under the mouse pointer but the pointer was moved outside the element.
onMouseOver JavaScript event handler executed when this element was not under the mouse pointer but the pointer is moved inside the element.
onMouseUp JavaScript event handler executed when this element is under the mouse pointer and a mouse button is released.
property Name of the request parameter that will be included with this submission, set to the specified value.
style CSS styles to be applied to this HTML element.
styleClass CSS stylesheet class to be applied to this HTML element.
tabIndex The tab order (ascending positive integers) for this element.
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"]
Top

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 Description
accessKey The keyboard character used to move focus immediately to this element.
onBlur JavaScript event handler executed when this element loses input focus.
onChange JavaScript event handler executed when this element loses input focus and its value has changed.
onClick JavaScript event handler executed when this element receives a mouse click.
onDblClick JavaScript event handler executed when this element receives a mouse double click.
onFocus JavaScript event handler executed when this element receives input focus.
onKeyDown JavaScript event handler executed when this element has focus and a key is depressed.
onKeyPress JavaScript event handler executed when this element has focus and a key is depressed and released.
onKeyUp JavaScript event handler executed when this element has focus and a key is released.
onMouseDown JavaScript event handler executed when this element is under the mouse pointer and a mouse button is depressed.
onMouseMove JavaScript event handler executed when this element is under the mouse pointer and the pointer is moved.
onMouseOut JavaScript event handler executed when this element was under the mouse pointer but the pointer was moved outside the element.
onMouseOver JavaScript event handler executed when this element was not under the mouse pointer but the pointer is moved inside the element.
onMouseUp JavaScript event handler executed when this element is under the mouse pointer and a mouse button is released.
property Name of the request parameter that will be included with this submission, set to the specified value. [org.apache.struts.taglib.CANCEL]
style CSS styles to be applied to this HTML element.
styleClass CSS stylesheet class to be applied to this HTML element.
tabIndex The tab order (ascending positive integers) for this element.
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"]
Top

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 Description
accessKey The keyboard character used to move focus immediately to this element.
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.
onBlur JavaScript event handler executed when this element loses input focus.
onChange JavaScript event handler executed when this element loses input focus and its value has changed.
onClick JavaScript event handler executed when this element receives a mouse click.
onDblClick JavaScript event handler executed when this element receives a mouse double click.
onFocus JavaScript event handler executed when this element receives input focus.
onKeyDown JavaScript event handler executed when this element has focus and a key is depressed.
onKeyPress JavaScript event handler executed when this element has focus and a key is depressed and released.
onKeyUp JavaScript event handler executed when this element has focus and a key is released.
onMouseDown JavaScript event handler executed when this element is under the mouse pointer and a mouse button is depressed.
onMouseMove JavaScript event handler executed when this element is under the mouse pointer and the pointer is moved.
onMouseOut JavaScript event handler executed when this element was under the mouse pointer but the pointer was moved outside the element.
onMouseOver JavaScript event handler executed when this element was not under the mouse pointer but the pointer is moved inside the element.
onMouseUp JavaScript event handler executed when this element is under the mouse pointer and a mouse button is released.
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 boolean.
style CSS styles to be applied to this HTML element.
styleClass CSS stylesheet class to be applied to this HTML element.
tabIndex The tab order (ascending positive integers) for this element.
value Value to which the checkbox should be initialized ("true", "false", "yes", or "no"). [Use the corresponding bean property value]
Top

enumerate - Repeat Tag Body For Elements of a Collection

Repeats the body of this tag once for each element of a collection, which must be an Enumeration, a Hashtable, a Vector, or an array of objects. The collection to be enumerated is identified by the name or name and property attributes, and the element being processed is exposed as a page scope bean named by the id attribute. Alternatively, you can specify the collection from a scripting variable directly, like this:

    <struts:enumerate id="item" collection="<%= myVector %>">

On a Java2 (JDK 1.2 or later) platform, you might want to consider using the iterate tag instead, which provides a superset of the capabilities of this tag.

Attribute Description
collection Collection over which enumeration should take place, initialized with a runtime expression as described above.
id Attribute name of the page scope bean that will be made visible to the body of the enumerate tag, containing the current element of the enumeration.
length The maximum number of entries (from the underlying collection) to be enumerated through. This can be either an integer that directly expresses the desired value, or the name of an attribute (in any scope) of type java.lang.Integer that defines the desired value. If not present, there will be no limit on the number of entries used.
name Attribute name of the collection bean itself (if property is not specified), or the bean whose property is retrieved (if property is specified). The collection may be in any scope, but must be one of the Java types described above.
offset The zero-relative starting point at which entries from the underlying collection will start being enumerated through. This can be either an integer that directly expresses the desired value, or the name of an attribute (in any scope) of type java.lang.Integer that defines the desired value. If not present, zero is assumed (meaning that the collection will be started from the beginning.
property Name of a property of the bean identified by name that is retrieved to provide the collection to be enumerated. [Use the bean identified by name itself]
Top

errors - Conditionally Display Error Messages

Displays a set of error messages prepared by a business logic component and stored as a String[] request scope bean. 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:

In an action class or other validation method, create a String array containing the message keys of the error messages you wish to display, and store the array as a request attribute under the key specified by the name attribute described below.

Attribute Description
name Name of the request scope bean under which a String[] object has possibly been stored. [The value of the org.apache.struts.Action.ERROR_KEY constant string]
Top

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.

NOTE: The Struts controller servlet does not currently support parsing or processing of file uploads. Therefore, you should ensure that the action attribute of this tag points at a suitable servlet that knows how to deal with the multipart/form-data content type.

Attribute Description
accessKey The keyboard character used to move focus immediately to this element.
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.
maxlength Maximum number of input characters to accept. [No limit]
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.
onBlur JavaScript event handler executed when this element loses input focus.
onChange JavaScript event handler executed when this element loses input focus and its value has changed.
onClick JavaScript event handler executed when this element receives a mouse click.
onDblClick JavaScript event handler executed when this element receives a mouse double click.
onFocus JavaScript event handler executed when this element receives input focus.
onKeyDown JavaScript event handler executed when this element has focus and a key is depressed.
onKeyPress JavaScript event handler executed when this element has focus and a key is depressed and released.
onKeyUp JavaScript event handler executed when this element has focus and a key is released.
onMouseDown JavaScript event handler executed when this element is under the mouse pointer and a mouse button is depressed.
onMouseMove JavaScript event handler executed when this element is under the mouse pointer and the pointer is moved.
onMouseOut JavaScript event handler executed when this element was under the mouse pointer but the pointer was moved outside the element.
onMouseOver JavaScript event handler executed when this element was not under the mouse pointer but the pointer is moved inside the element.
onMouseUp JavaScript event handler executed when this element is under the mouse pointer and a mouse button is released.
onSelect JavaScript event handler executed when this element has focus and some text is selected.
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. It is used to set the default filename selection choice.
size Number of character positions to allocate. [Browser default]
style CSS styles to be applied to this HTML element.
styleClass CSS stylesheet class to be applied to this HTML element.
tabIndex The tab order (ascending positive integers) for this element.
value Default filename which should be preselected when this input element is rendered. [Use the corresponding bean property value]
Top

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 Description
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]
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.
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.
method The HTTP method that will be used to submit this request (GET, POST). [POST]
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.
onReset JavaScript event handler executed if the form is reset.
onSubmit JavaScript event handler executed if the form is submitted.
scope JSP scope within which the associated bean will be accessed or created (request, session). [session]
style CSS styles to be applied to this HTML element.
styleClass CSS stylesheet class to be applied to this HTML element.
target Window target to which this form is submitted, such as for use in framed presentations.
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]
Top

forward - Forward or Redirect to a Logically Named Page

Looks up a logical name in the collection of global ActionForward entries configured for our controller servlet, and performs either a forward or redirect to the corresponding actual path (based on the value of the redirect property.

Attribute Description
name Logical name of the ActionForward entry to be looked up.
Top

getProperty - Expose Bean Property as an Attribute

Retrieves the value of the specified property from the specified bean, and exposes it as a page scope bean for use by other tags.

Attribute Description
id Name of the page scope bean under which the retrieved attribute will be retrieved.
name Name of the bean (which can be in any scope) whose specified property value is retrieved and exposed.
property Name of the property whose value is retrieved and exposed.
Top

hidden - Render A Hidden 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 Description
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.
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.
value Value to which this field should be initialized. [Use the corresponding bean property value]
Top

htmlProperty - Render A Bean Property

Retrieves the value of the specified property from the specified bean, and renders it to the output stream, with suitable filtering for characters that are sensitive in HTML.

Attribute Description
name Name of the bean (which can be in any scope) whose specified property value is retrieved and rendered.
property Name of the property whose value is retrieved and rendered.
Top

ifAttributeExists - Conditionally Evaluate Tag Body

Evaluates and processes the body of this tag if the specified attribute exists in the specified scope. Otherwise, the body of this tag is skipped.

Attribute Description
name Name of the attribute whose existence is tested.
scope The scope within which this attribute's existence is tested (must be "application", "page", "request", or "session"). If not specified, session scope is assumed.
Top

ifAttributeMissing - Conditionally Evaluate Tag Body

Evaluates and processes the body of this tag if the specified attribute exists in the specified scope. Otherwise, the body of this tag is skipped.

This tag might commonly be used to test for the existence of a user login object in session scope. If such an object is missing (either because the user tried to bypass logging in, or because their session timed out and a new one was created), they can be redirected to the login page like this:

    <struts:ifAttributeMissing name="userObject">
      <jsp:forward page="login.jsp"/>
    <struts:ifAttributeMissing>
Attribute Description
name Name of the attribute whose existence is tested.
scope The scope within which this attribute's existence is tested (must be "application", "page", "request", or "session"). If not specified, session scope is assumed.
Top

ifParameterEquals - Conditionally Evaluate Tag Body

Evaluates and processes the body of this tag if the specified parameter included with this request has the specified value. Otherwise, the body of this tag is skipped.

Attribute Description
name Name of the request parameter whose value must match for conditional evaluation of the tag body to take place.
value Value that must match exactly in order for conditional evaluation of the tag body to take place.
Top

ifParameterNotEquals - Conditionally Evaluate Tag Body

Evaluates and processes the body of this tag if the specified parameter included with this request does not match the specified value (or it is omitted). Otherwise, the body of this tag is skipped.

Attribute Description
name Name of the request parameter whose value must not match for conditional evaluation of the tag body to take place.
value Value that must not match exactly in order for conditional evaluation of the tag body to take place.
Top

ifParameterNotNull - Conditionally Evaluate Tag Body

Evaluates and processes the body of this tag if the specified parameter was included in this request with a length greater than zero.

Attribute Description
name Name of the request parameter whose value must be present for conditional evaluation of the tag body to take place.
Top

ifParameterNull - Conditionally Evaluate Tag Body

Evaluates and processes the body of this tag if the specified parameter was not included in this request, or is present with a length of zero.

Attribute Description
name Name of the request parameter whose value must not be present for conditional evaluation of the tag body to take place.
Top

include - Include a Logically Named Page

Looks up a logical name in the collection of global ActionForward entries configured for our controller servlet, and performs an include of the content of the corresponding actual path.

Attribute Description
name Logical name of the ActionForward entry to be looked up.
Top

iterate - Repeat Tag Body For Elements of a Collection

Repeats the body of this tag once for each element of a collection, which must be an Iterator, a Collection (which includes Lists, Sets, and Vectors), a Map (which includes Hashtables) whose elements will be iterated over, or an array of objects. The collection to be iterated over is identified by the name or name and property attributes, and the element being processed is exposed as a page scope bean named by the id attribute. Alternatively, you can specify the collection from a scripting variable directly, like this:

    <struts:iterate id="item" collection="<%= myVector %>">

This tag requires a Java2 (JDK 1.2 or later) platform. For a JDK 1.1 platform, the enumerate tag provides similar functionality.

Attribute Description
collection Collection over which iteration should take place, initialized with a runtime expression as described above.
id Attribute name of the page scope bean that will be made visible to the body of the iterate tag, containing the current element of the enumeration.
length The maximum number of entries (from the underlying collection) to be iterated through. This can be either an integer that directly expresses the desired value, or the name of an attribute (in any scope) of type java.lang.Integer that defines the desired value. If not present, there will be no limit on the number of entries used.
name Attribute name of the collection bean itself (if property is not specified), or the bean whose property is retrieved (if property is specified). The collection may be in any scope, but must be one of the Java types described above.
offset The zero-relative starting point at which entries from the underlying collection will start being iterated through. This can be either an integer that directly expresses the desired value, or the name of an attribute (in any scope) of type java.lang.Integer that defines the desired value. If not present, zero is assumed (meaning that the collection will be started from the beginning.
property Name of a property of the bean identified by name that is retrieved to provide the collection to be enumerated. [Use the bean identified by name itself]
Top

link - Render HTML Hyperlink

Renders an HTML <a> element 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.

Normally, the hyperlink you specify with the forward or href attribute will be unchanged (other than the fact that URL rewriting will be applied if necessary for session maintenance in the absence of cookies). However, you can specify instructions for locating a Map implementation that defines query parameters to be added to the hyperlink, in one of two manners:

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 values. If a String array is specified, more than one value for the same query parameter name may be created.

This tag works only on a Java2 (JDK 1.2 or later) platform, because of the use of the java.util.Map interface. For a similar tag based on a java.util.Dictionary, and therefore works on JDK 1.1, see the link1 tag.

Attribute Description
forward Logical name of a global ActionForward that contains the actual context-relative URI of the destination of this transfer. This hyperlink may be dynamically modified by the inclusion of query parameters if the name (or name and property) attributes are also present on this tag. You must specify either the forward attribute or the href attribute.
href URL to which this hyperlink will transfer if activated. This hyperlink may be dynamically modified by the inclusion of query parameters if the name (or name and property) attributes are also present on this tag. You must specify either the forward attribute or the href attribute.
name Name of the bean that contains a Map representing the query parameters to be added to our hyperlink, if the property attribute is not present. If it is, the appropriate property getter will be called to return the Map.
property Name of a property, of the bean specified by the name attribute, that will be called to return a Map representing the query parameters to be added to our hyperlink. It is not legal to specify this attribute without also specifying a name.
target Window target in which the requested resource will be displayed, such as for use in framed presentations.
Top

link - Render HTML Hyperlink

Renders an HTML <a> element 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.

Normally, the hyperlink you specify with the forward or href attribute will be unchanged (other than the fact that URL rewriting will be applied if necessary for session maintenance in the absence of cookies). However, you can specify instructions for locating a Dictionary implementation that defines query parameters to be added to the hyperlink, in one of two manners:

As the Dictionary 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 values. If a String array is specified, more than one value for the same query parameter name may be created.

This tag will work on a JDK 1.1 platform. If you are running on a Java2 (JDK 1.2 or later) platform, consider using the link tag instead.

Attribute Description
forward Logical name of a global ActionForward that contains the actual context-relative URI of the destination of this transfer. This hyperlink may be dynamically modified by the inclusion of query parameters if the name (or name and property) attributes are also present on this tag. You must specify either the forward attribute or the href attribute.
href URL to which this hyperlink will transfer if activated. This hyperlink may be dynamically modified by the inclusion of query parameters if the name (or name and property) attributes are also present on this tag. You must specify either the forward attribute or the href attribute.
name Name of the bean that contains a Dictionary representing the query parameters to be added to our hyperlink, if the property attribute is not present. If it is, the appropriate property getter will be called to return the Dictionary.
property Name of a property, of the bean specified by the name attribute, that will be called to return a Dictionary representing the query parameters to be added to our hyperlink. It is not legal to specify this attribute without also specifying a name.
target Window target in which the requested resource will be displayed, such as for use in framed presentations.
Top

message - Render An Internationalized Message

Retrieves an internationalized message for the specified Locale, using the specified key, and renders it to the output stream. If the message supports parametric replacements (such as "{0}"), you can specify up to four argument values to use as replacement text.

Attribute Description
arg0 First parameteric replacement value, if any. [None]
arg1 Second parameteric replacement value, if any. [None]
arg2 Third parameteric replacement value, if any. [None]
arg3 Fourth parameteric replacement value, if any. [None]
bundle Application scope attribute under which the MessageResources bean containing our messages is stored. [The value of the Action.MESSAGES_KEY constant string]
key Message key of the requested message, which must have a corresponding value in the resources.
locale Session scope attribute under which the Locale bean selected by the current user is stored. If no such bean is found, the system default Locale will be used. [The value of the Action.LOCALE_KEY constant string]
Top

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 Description
accessKey The keyboard character used to move focus immediately to this element.
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.
onBlur JavaScript event handler executed when this element loses input focus.
onChange JavaScript event handler executed when this element loses input focus and its value has changed.
onClick JavaScript event handler executed when this element receives a mouse click.
onDblClick JavaScript event handler executed when this element receives a mouse double click.
onFocus JavaScript event handler executed when this element receives input focus.
onKeyDown JavaScript event handler executed when this element has focus and a key is depressed.
onKeyPress JavaScript event handler executed when this element has focus and a key is depressed and released.
onKeyUp JavaScript event handler executed when this element has focus and a key is released.
onMouseDown JavaScript event handler executed when this element is under the mouse pointer and a mouse button is depressed.
onMouseMove JavaScript event handler executed when this element is under the mouse pointer and the pointer is moved.
onMouseOut JavaScript event handler executed when this element was under the mouse pointer but the pointer was moved outside the element.
onMouseOver JavaScript event handler executed when this element was not under the mouse pointer but the pointer is moved inside the element.
onMouseUp JavaScript event handler executed when this element is under the mouse pointer and a mouse button is released.
property Name of this input field, and the name of the corresponding bean property whose value is used to initialize our "checked" status. The underlying bean property must be of an array type whose current values can be converted to Strings and compared the the value of the value attribute.
style CSS styles to be applied to this HTML element.
styleClass CSS stylesheet class to be applied to this HTML element.
tabIndex The tab order (ascending positive integers) for this element.
value The value which, if present in one of the array elements of our attribute's current value, will cause this checkbox to be initialized to "checked".
Top

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 Description
value Value to be submitted for this field if this option is selected by the user.
Top

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 particular <struts:select> element, either in conjunction with or instead of one or more <struts:option> tags.

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

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:

See options1 for a version of this tag that is compatible with JDK 1.1.

.
Attribute Description
labelName Name of the JSP bean (in some scope) containing the collection of labels to be displayed to the user for these options.
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.
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.
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.
Top

options1 - 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 particular <struts:select> element, either in conjunction with or instead of one or more <struts:option> tags.

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

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:

See options for a version of this tag that is compatible with Java2.

.
Attribute Description
labelName Name of the JSP bean (in some scope) containing the collection of labels to be displayed to the user for these options.
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.
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.
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.
Top

parameter - Render Request Parameter

Renders the value of the specified request parameter, suitably filtered for characters that are sensitive in HTML.

Attribute Description
name Name of the request parameter whose value is to be rendered.
Top

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 Description
accessKey The keyboard character used to move focus immediately to this element.
maxlength Maximum number of input characters to accept. [No limit]
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.
onBlur JavaScript event handler executed when this element loses input focus.
onChange JavaScript event handler executed when this element loses input focus and its value has changed.
onClick JavaScript event handler executed when this element receives a mouse click.
onDblClick JavaScript event handler executed when this element receives a mouse double click.
onFocus JavaScript event handler executed when this element receives input focus.
onKeyDown JavaScript event handler executed when this element has focus and a key is depressed.
onKeyPress JavaScript event handler executed when this element has focus and a key is depressed and released.
onKeyUp JavaScript event handler executed when this element has focus and a key is released.
onMouseDown JavaScript event handler executed when this element is under the mouse pointer and a mouse button is depressed.
onMouseMove JavaScript event handler executed when this element is under the mouse pointer and the pointer is moved.
onMouseOut JavaScript event handler executed when this element was under the mouse pointer but the pointer was moved outside the element.
onMouseOver JavaScript event handler executed when this element was not under the mouse pointer but the pointer is moved inside the element.
onMouseUp JavaScript event handler executed when this element is under the mouse pointer and a mouse button is released.
onSelect JavaScript event handler executed when this element has focus and some text is selected.
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.
size Number of character positions to allocate. [Browser default]
style CSS styles to be applied to this HTML element.
styleClass CSS stylesheet class to be applied to this HTML element.
tabIndex The tab order (ascending positive integers) for this element.
value Value to which this field should be initialized. [Use the corresponding bean property value]
Top

property - Render A Read-only Property Value

Renders the value of the specified property as read-only text. It is similar to the standard <jsp:getProperty> tag, but also filters the output text for characters that HTML is sensitive to. This tag is only valid when nested inside a form tag body.

Attribute Description
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.
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.
value Value to which this field should be initialized. [Use the corresponding bean property value]
Top

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 Description
accessKey The keyboard character used to move focus immediately to this element.
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.
onBlur JavaScript event handler executed when this element loses input focus.
onChange JavaScript event handler executed when this element loses input focus and its value has changed.
onClick JavaScript event handler executed when this element receives a mouse click.
onDblClick JavaScript event handler executed when this element receives a mouse double click.
onFocus JavaScript event handler executed when this element receives input focus.
onKeyDown JavaScript event handler executed when this element has focus and a key is depressed.
onKeyPress JavaScript event handler executed when this element has focus and a key is depressed and released.
onKeyUp JavaScript event handler executed when this element has focus and a key is released.
onMouseDown JavaScript event handler executed when this element is under the mouse pointer and a mouse button is depressed.
onMouseMove JavaScript event handler executed when this element is under the mouse pointer and the pointer is moved.
onMouseOut JavaScript event handler executed when this element was under the mouse pointer but the pointer was moved outside the element.
onMouseOver JavaScript event handler executed when this element was not under the mouse pointer but the pointer is moved inside the element.
onMouseUp JavaScript event handler executed when this element is under the mouse pointer and a mouse button is released.
property Name of this input field, and the name of the corresponding bean property. The corresponding bean property must be of type String.
style CSS styles to be applied to this HTML element.
styleClass CSS stylesheet class to be applied to this HTML element.
tabIndex The tab order (ascending positive integers) for this element.
value Value that is matched against the underlying bean property value. If the property has the same value, this radio button will be rendered as checked.
Top

Redirect - Perform a Client Redirect

Perform a response.sendRedirect() call to the specified URL, and skip evaluation of the remainder of this page. URL rewriting will be applied automatically to maintain session state in the absence of cookies.

Attribute Description
href URL to which the user will be redirected.
Top

reset - Render a Reset Button

Renders an HTML <input> element of type reset. This tag is only valid when nested inside a form tag body.

Attribute Description
accessKey The keyboard character used to move focus immediately to this element.
onBlur JavaScript event handler executed when this element loses input focus.
onChange JavaScript event handler executed when this element loses input focus and its value has changed.
onClick JavaScript event handler executed when this element receives a mouse click.
onDblClick JavaScript event handler executed when this element receives a mouse double click.
onFocus JavaScript event handler executed when this element receives input focus.
onKeyDown JavaScript event handler executed when this element has focus and a key is depressed.
onKeyPress JavaScript event handler executed when this element has focus and a key is depressed and released.
onKeyUp JavaScript event handler executed when this element has focus and a key is released.
onMouseDown JavaScript event handler executed when this element is under the mouse pointer and a mouse button is depressed.
onMouseMove JavaScript event handler executed when this element is under the mouse pointer and the pointer is moved.
onMouseOut JavaScript event handler executed when this element was under the mouse pointer but the pointer was moved outside the element.
onMouseOver JavaScript event handler executed when this element was not under the mouse pointer but the pointer is moved inside the element.
onMouseUp JavaScript event handler executed when this element is under the mouse pointer and a mouse button is released.
style CSS styles to be applied to this HTML element.
styleClass CSS stylesheet class to be applied to this HTML element.
tabIndex The tab order (ascending positive integers) for this element.
value Value of the label to be placed on this button. [Body of this tag (if any), or "Reset"]
Top

select - Render a Select Input Field

Renders an HTML <select> element, whose available options are described by <option> elements nested in the tag body of this tag. This tag is only valid when nested inside a form tag body.

Attribute Description
accessKey The keyboard character used to move focus immediately to this element.
multiple If set to any arbitrary value, the rendered select element will support multiple selections. You cannot simply say "multiple", because this conflicts with XML syntax rules about attribute minimization (which was allowed in HTML).
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.
onBlur JavaScript event handler executed when this element loses input focus.
onChange JavaScript event handler executed when this element loses input focus and its value has changed.
onClick JavaScript event handler executed when this element receives a mouse click.
onDblClick JavaScript event handler executed when this element receives a mouse double click.
onFocus JavaScript event handler executed when this element receives input focus.
onKeyDown JavaScript event handler executed when this element has focus and a key is depressed.
onKeyPress JavaScript event handler executed when this element has focus and a key is depressed and released.
onKeyUp JavaScript event handler executed when this element has focus and a key is released.
onMouseDown JavaScript event handler executed when this element is under the mouse pointer and a mouse button is depressed.
onMouseMove JavaScript event handler executed when this element is under the mouse pointer and the pointer is moved.
onMouseOut JavaScript event handler executed when this element was under the mouse pointer but the pointer was moved outside the element.
onMouseOver JavaScript event handler executed when this element was not under the mouse pointer but the pointer is moved inside the element.
onMouseUp JavaScript event handler executed when this element is under the mouse pointer and a mouse button is released.
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.
size Define the number of available options that will be displayed when this select element is rendered. If not specified, the browser default value will be used (typically 1).
style CSS styles to be applied to this HTML element.
styleClass CSS stylesheet class to be applied to this HTML element.
tabIndex The tab order (ascending positive integers) for this element.
value Value to which this field should be initialized. [Use the corresponding bean property value]
Top

submit - Render a Submit Button

Renders an HTML <input> element of type submit. This tag is only valid when nested inside a form tag body.

Attribute Description
accessKey The keyboard character used to move focus immediately to this element.
onBlur JavaScript event handler executed when this element loses input focus.
onChange JavaScript event handler executed when this element loses input focus and its value has changed.
onClick JavaScript event handler executed when this element receives a mouse click.
onDblClick JavaScript event handler executed when this element receives a mouse double click.
onFocus JavaScript event handler executed when this element receives input focus.
onKeyDown JavaScript event handler executed when this element has focus and a key is depressed.
onKeyPress JavaScript event handler executed when this element has focus and a key is depressed and released.
onKeyUp JavaScript event handler executed when this element has focus and a key is released.
onMouseDown JavaScript event handler executed when this element is under the mouse pointer and a mouse button is depressed.
onMouseMove JavaScript event handler executed when this element is under the mouse pointer and the pointer is moved.
onMouseOut JavaScript event handler executed when this element was under the mouse pointer but the pointer was moved outside the element.
onMouseOver JavaScript event handler executed when this element was not under the mouse pointer but the pointer is moved inside the element.
onMouseUp JavaScript event handler executed when this element is under the mouse pointer and a mouse button is released.
property Name of the request parameter that will be included with this submission, set to the specified value. [submit]
style CSS styles to be applied to this HTML element.
styleClass CSS stylesheet class to be applied to this HTML element.
tabIndex The tab order (ascending positive integers) for this element.
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 "Submit"]
Top

text - Render A Text Input Field

Renders an HTML <input> element of type text/code>, 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 Description
accessKey The keyboard character used to move focus immediately to this element.
maxlength Maximum number of input characters to accept. [No limit]
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.
onBlur JavaScript event handler executed when this element loses input focus.
onChange JavaScript event handler executed when this element loses input focus and its value has changed.
onClick JavaScript event handler executed when this element receives a mouse click.
onDblClick JavaScript event handler executed when this element receives a mouse double click.
onFocus JavaScript event handler executed when this element receives input focus.
onKeyDown JavaScript event handler executed when this element has focus and a key is depressed.
onKeyPress JavaScript event handler executed when this element has focus and a key is depressed and released.
onKeyUp JavaScript event handler executed when this element has focus and a key is released.
onMouseDown JavaScript event handler executed when this element is under the mouse pointer and a mouse button is depressed.
onMouseMove JavaScript event handler executed when this element is under the mouse pointer and the pointer is moved.
onMouseOut JavaScript event handler executed when this element was under the mouse pointer but the pointer was moved outside the element.
onMouseOver JavaScript event handler executed when this element was not under the mouse pointer but the pointer is moved inside the element.
onMouseUp JavaScript event handler executed when this element is under the mouse pointer and a mouse button is released.
onSelect JavaScript event handler executed when this element has focus and some text is selected.
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.
size Number of character positions to allocate. [Browser default]
style CSS styles to be applied to this HTML element.
styleClass CSS stylesheet class to be applied to this HTML element.
tabIndex The tab order (ascending positive integers) for this element.
value Value to which this field should be initialized. [Use the corresponding bean property value]
Top

textarea - Render A Textarea Input Field

Renders an HTML <textarea> element, based on the specified attributes. This tag is only valid when nested inside a form tag body.

Attribute Description
accessKey The keyboard character used to move focus immediately to this element.
cols Number of columns displayed in the textarea. [Browser default]
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.
onBlur JavaScript event handler executed when this element loses input focus.
onChange JavaScript event handler executed when this element loses input focus and its value has changed.
onClick JavaScript event handler executed when this element receives a mouse click.
onDblClick JavaScript event handler executed when this element receives a mouse double click.
onFocus JavaScript event handler executed when this element receives input focus.
onKeyDown JavaScript event handler executed when this element has focus and a key is depressed.
onKeyPress JavaScript event handler executed when this element has focus and a key is depressed and released.
onKeyUp JavaScript event handler executed when this element has focus and a key is released.
onMouseDown JavaScript event handler executed when this element is under the mouse pointer and a mouse button is depressed.
onMouseMove JavaScript event handler executed when this element is under the mouse pointer and the pointer is moved.
onMouseOut JavaScript event handler executed when this element was under the mouse pointer but the pointer was moved outside the element.
onMouseOver JavaScript event handler executed when this element was not under the mouse pointer but the pointer is moved inside the element.
onMouseUp JavaScript event handler executed when this element is under the mouse pointer and a mouse button is released.
onSelect JavaScript event handler executed when this element has focus and some text is selected.
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.
rows Number of rows displayed in the textarea. [Browser default]
style CSS styles to be applied to this HTML element.
styleClass CSS stylesheet class to be applied to this HTML element.
tabIndex The tab order (ascending positive integers) for this element.
value Value to which this field should be initialized. [Use the corresponding bean property value]
Top