Apache struts 1.2.9 html taglib reference

原文参考 http://struts.apache.org/1.2.9/userGuide/struts-html.html#link

This taglib containstags used to create struts input forms, as well as other tags generally usefulin the creation of HTML-based user interfaces.

Many of the tags in thistag library will throw a JspException at runtime when they are utilized incorrectly(such as when you specify an invalid combination of tag attributes). JSP allowsyou to declare an "error page" in the <%@ page %>directive. If you wish to process the actual exception that caused the problem,it is passed to the error page as a request attribute under key org.apache.struts.action.EXCEPTION.

Tag Name

Description

base

Render 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

frame

Render an HTML frame element

hidden

Render A Hidden Field

html

Render an HTML <html> Element

image

Render an input tag of type "image"

img

Render an HTML img tag

javascript

Render JavaScript validation based on the validation rules loaded by the ValidatorPlugIn.

link

Render an HTML anchor or hyperlink

messages

Conditionally display a set of accumulated messages.

multibox

Render A Checkbox Input Field

option

Render A Select Option

options

Render a Collection of Select Options

optionsCollection

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

rewrite

Render an URI

select

Render A Select Element

submit

Render A Submit Button

text

Render An Input Field of Type text

textarea

Render A Textarea

xhtml

Render HTML tags as XHTML

base - Render an HTML <base> Element

Renders an HTML <base> element with an href attribute pointing tothe absolute location of the enclosing JSP page. This tag is valid only whennested inside an HTML <head> element.

This tag is usefulbecause it allows you to use relative URL references in the page that arecalculated based on the URL of the page itself, rather than the URL to whichthe most recent submit took place (which is where the browser would normallyresolve relative references against).

Attribute Name

Description

target

The window target for this base reference.

[RT Expr]

server

The server name to use instead of request.getServerName().

[RT Expr]

Back totop

button - Render A Button Input Field

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

If a graphical button isneeded (a button with an image), then the image tag is moreappropriate.

Attribute Name

Description

accesskey

The keyboard character used to move focus immediately to this element. [RT Expr]

alt

The alternate text for this element.

[RT Expr]

altKey

The message resources key of the alternate text for this element.

[RT Expr]

bundle

The servlet context attributes key for the MessageResources instance to use. If not specified, defaults to the application resources configured for our action servlet.

Since: Struts 1.2.5

[RT Expr]

disabled

Set to true if this input field should be disabled. [RT Expr]

indexed

Valid only inside of logic:iterate tag. If true then name of the html tag will be rendered as "propertyName[34]". Number in brackets will be generated for every iteration and taken from ancestor logic:iterate tag. [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 (renders a "class" attribute). [RT Expr]

styleId

Identifier to be assigned to this HTML element (renders an "id" attribute). [RT Expr]

tabindex

The tab order (ascending positive integers) for this element. [RT Expr]

title

The advisory title for this element.

[RT Expr]

titleKey

The message resources key for the advisory title 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]

Back totop

cancel - Render a Cancel Button

Renders an HTML<input> element of type submit. This tag is only valid when nested insidea form tag body. Pressing of this submit button causes the action servlet tobypass calling the associated form bean validate() method. The action is callednormally.

Attribute Name

Description

accesskey

The keyboard character used to move focus immediately to this element. [RT Expr]

alt

The alternate text for this element.

[RT Expr]

altKey

The message resources key of the alternate text for this element.

[RT Expr]

bundle

The servlet context attributes key for the MessageResources instance to use. If not specified, defaults to the application resources configured for our action servlet.

Since: Struts 1.2.5

[RT Expr]

disabled

Set to true if this input field should be disabled. [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. WARNING - If you set this attribute to a value other than the default, this will NOT be recognized as the cancel key by the Struts controller servlet or the Action.isCancelled() method. You will need to do your own cancel detection. [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 (renders a "class" attribute). [RT Expr]

styleId

Identifier to be assigned to this HTML element (renders an "id" attribute). [RT Expr]

tabindex

The tab order (ascending positive integers) for this element. [RT Expr]

title

The advisory title for this element.

[RT Expr]

titleKey

The message resources key for the advisory title 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]

Back totop

checkbox - Render A Checkbox Input Field

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

NOTE: The underlying property value associated withthis field should be of type boolean, and any value you specify should correspond to one of theStrings that indicate a true value ("true", "yes", or"on"). If you wish to utilize a set of related String values,consider using the multibox tag.

WARNING: In order to correctly recognize uncheckedcheckboxes, the ActionForm bean associated with this form must include astatement setting the corresponding boolean property to false in the reset() method.

Attribute Name

Description

accesskey

The keyboard character used to move focus immediately to this element. [RT Expr]

alt

The alternate text for this element.

[RT Expr]

altKey

The message resources key of the alternate text for this element.

[RT Expr]

bundle

The servlet context attributes key for the MessageResources instance to use. If not specified, defaults to the application resources configured for our action servlet.

Since: Struts 1.2.5

[RT Expr]

disabled

Set to true if this input field should be disabled. [RT Expr]

errorKey

Name of the request scope bean under which our error messages have been stored. If not present, the name specified by the Globals.ERROR_KEY constant string will be used.

N.B. This is used in conjunction with the errorStyle, errorStyleClass and errorStyleId attributes and should be set to the same value as the name attribute on the <html:errors/> tag.

Since: Struts 1.2.5

[RT Expr]

errorStyle

CSS styles to be applied to this HTML element if an error exists for it.

N.B. If present, this overrides the style attribute in the event of an error.

Since: Struts 1.2.5

[RT Expr]

errorStyleClass

CSS stylesheet class to be applied to this HTML element if an error exists for it (renders a "class" attribute).

N.B. If present, this overrides the styleClass attribute in the event of an error.

Since: Struts 1.2.5

[RT Expr]

errorStyleId

Identifier to be assigned to this HTML element if an error exists for it (renders an "id" attribute).

N.B. If present, this overrides the styleId attribute in the event of an error.

Since: Struts 1.2.5

[RT Expr]

indexed

Valid only inside of logic:iterate tag. If true then name of the html tag will be rendered as "id[34].propertyName". Number in brackets will be generated for every iteration and taken from ancestor logic:iterate tag. [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.

N.B. If present, the errorStyle overrides this attribute in the event of an error for the element.

[RT Expr]

styleClass

CSS stylesheet class to be applied to this HTML element (renders a "class" attribute).

N.B. If present, the errorStyleClass overrides this attribute in the event of an error for the element.

[RT Expr]

styleId

Identifier to be assigned to this HTML element (renders an "id" attribute).

N.B. If present, the errorStyleId overrides this attribute in the event of an error for the element.

[RT Expr]

tabindex

The tab order (ascending positive integers) for this element. [RT Expr]

title

The advisory title for this element.

[RT Expr]

titleKey

The message resources key for the advisory title for this element.

[RT Expr]

value

The value to be transmitted if this checkbox is checked when the form is submitted. If not specified, the value "on" will be returned. [RT Expr]

Back totop

errors - Conditionally display a set of accumulated error messages.

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

In order to use this tagsuccessfully, you must have defined an application scope MessageResourcesbean under the default attribute name, with optional definitions of messagekeys specified in the following attributes:

·        header - Text that will be rendered before the errormessages list. Typically, this message text will end with <ul> to start the errormessages list (default "errors.header").

·        footer - Text that will be rendered after the errormessages list. Typically, this message text will begin with </ul> to end the errormessages list (default "errors.footer").

·        prefix - Text that will be rendered before eachindividual error in the list (default "errors.prefix").

·        suffix - Text that will be rendered after eachindividual error in the list (default "errors.suffix").

Attribute Name

Description

bundle

The servlet context attribute key for the MessageResources instance to use. If not specified, defaults to the application resources configured for our action servlet. [RT Expr]

footer

This value is an optional message resource key that will be printed after the iteration of error messages has finished. Defaults to "errors.footer" if not specified.

Since: Struts 1.2.5

[RT Expr]

header

This value is an optional message resource key that will be printed before the iteration of error messages begins. Defaults to "errors.header" if not specified.

Since: Struts 1.2.5

[RT Expr]

locale

The session attribute key for the Locale used to select messages to be displayed. If not specified, defaults to the Struts standard value. [RT Expr]

name

Name of the request scope bean under which our error messages have been stored. If not present, the name specified by the Globals.ERROR_KEY constant string will be used. [RT Expr]

prefix

This value is an optional message resource key that will be printed before an error message. Defaults to "errors.prefix" if not specified.

Since: Struts 1.2.5

[RT Expr]

property

Name of the property for which error messages should be displayed. If not specified, all error messages (regardless of property) are displayed. [RT Expr]

suffix

This value is an optional message resource key that will be printed after an error message. Defaults to "errors.suffix" if not specified.

Since: Struts 1.2.5

[RT Expr]

Back totop

file - Render A File Select Input Field

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

As with thecorresponding HTML <input> element, the enclosing form element mustspecify "POST" for the method attribute, and "multipart/form-data"for the enctype attribute. For example:

    <html:formmethod="POST" enctype="multipart/form-data">

        <html:fileproperty="theFile" />

    </html:form>

WARNING: In order tocorrectly recognize uploaded files, the ActionForm bean associated with thisform must include a statement setting the correspondingorg.apache.struts.upload.FormFile property to null in the reset() method.

Attribute Name

Description

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]

alt

The alternate text for this element.

[RT Expr]

altKey

The message resources key of the alternate text for this element.

[RT Expr]

bundle

The servlet context attributes key for the MessageResources instance to use. If not specified, defaults to the application resources configured for our action servlet.

Since: Struts 1.2.5

[RT Expr]

disabled

Set to true if this input field should be disabled. [RT Expr]

errorKey

Name of the request scope bean under which our error messages have been stored. If not present, the name specified by the Globals.ERROR_KEY constant string will be used.

N.B. This is used in conjunction with the errorStyle, errorStyleClass and errorStyleId attributes and should be set to the same value as the name attribute on the <html:errors/> tag.

Since: Struts 1.2.5

[RT Expr]

errorStyle

CSS styles to be applied to this HTML element if an error exists for it.

N.B. If present, this overrides the style attribute in the event of an error.

Since: Struts 1.2.5

[RT Expr]

errorStyleClass

CSS stylesheet class to be applied to this HTML element if an error exists for it (renders a "class" attribute).

N.B. If present, this overrides the styleClass attribute in the event of an error.

Since: Struts 1.2.5

[RT Expr]

errorStyleId

Identifier to be assigned to this HTML element if an error exists for it (renders an "id" attribute).

N.B. If present, this overrides the styleId attribute in the event of an error.

Since: Struts 1.2.5

[RT Expr]

indexed

Valid only inside of logic:iterate tag. If true then name of the html tag will be rendered as "id[34].propertyName". Number in brackets will be generated for every iteration and taken from ancestor logic:iterate tag. [RT Expr]

maxlength

Maximum number of input characters to accept. This is ignored by most browsers. [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]

size

Size of the file selection box to be displayed. [RT Expr]

style

CSS styles to be applied to this HTML element.

N.B. If present, the errorStyle overrides this attribute in the event of an error for the element.

[RT Expr]

styleClass

CSS stylesheet class to be applied to this HTML element (renders a "class" attribute).

N.B. If present, the errorStyleClass overrides this attribute in the event of an error for the element.

[RT Expr]

styleId

Identifier to be assigned to this HTML element (renders an "id" attribute).

N.B. If present, the errorStyleId overrides this attribute in the event of an error for the element.

[RT Expr]

tabindex

The tab order (ascending positive integers) for this element. [RT Expr]

title

The advisory title for this element.

[RT Expr]

titleKey

The message resources key for the advisory title for this element.

[RT Expr]

value

NOTE: When setting this to some value, whether intentional or as the result (for example) of validation errors forcing the user back to the original jsp, this value is ignored by most browsers (for security reasons). This means that your users will have to re-select any previously selected files when submitting the form. Opera web browser will prompt the user so they have a chance to abort the submit.

Value to which this field should be initialized. [Use the corresponding bean property value or body content (if any) if property is not specified] [RT Expr]

Back totop

form - Define An Input Form

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

The form bean islocated, and created if necessary, based on the form bean specification for theassociated ActionMapping.

Attribute Name

Description

action

The URL to which this form will be submitted. This value is also used to select the ActionMapping we are assumed to be processing, from which we can identify the appropriate form bean and scope.

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

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

[Required] [RT Expr]

acceptCharset

The list of character encodings for input data that the server should accept.

Since: Struts 1.2.2

[RT Expr]

disabled

Set to true if the Form's input fields should be disabled.

Since: Struts 1.2.7

[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]

focusIndex

If the focus field is a field array, such as a radio button group, you can specify the index in the array to receive focus.

Since: Struts 1.1

[RT Expr]

method

The HTTP method that will be used to submit this request (GET, POST). [POST] [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]

readonly

Set to true if the Form's input fields should be read only.

Since: Struts 1.2.7

[RT Expr]

scriptLanguage

The form's focus <script> element will not contain a language attribute when this is set to false. The default is true but this property is ignored in XHMTL mode.

Since: Struts 1.2

[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 (renders a "class" attribute). [RT Expr]

styleId

Identifier to be assigned to this HTML element (renders an "id" attribute). [RT Expr]

target

Window target to which this form is submitted, such as for use in framed presentations. [RT Expr]

Back totop

frame - Render an HTML frame element

Renders an HTML <frame>element with processing for the src attribute that is identical to that performedby the <html:link> tag for the href attribute. URL rewriting will be appliedautomatically, to maintain session state in the absence of cookies.

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

·        forward - Use the value of this attribute as the nameof a global ActionForward to be looked up, and use the module-relative orcontext-relative URI found there.

·        href - Use the value of this attribute unchanged.

·        page - Use the value of this attribute as amodule-relative URI, and generate a server-relative URI by including thecontext path and application prefix.

·        action - Use the value of this attribute as thelogical name of a global Action that contains the actual content-relative URIof the destination of this transfer.

Normally, the hyperlinkyou specify with one of the attributes described in the previous paragraph willbe left unchanged (other than URL rewriting if necessary). However, there aretwo ways you can append one or more dynamically defined query parameters to thehyperlink -- specify a single parameter with the paramId attribute (and itsassociated attributes to select the value), or specify the name (and optional property) attributes to select ajava.util.Map bean that contains one or more parameter ids and correspondingvalues.

To specify a singleparameter, use the paramId attribute to define the name of the requestparameter to be submitted. To specify the corresponding value, use one of thefollowing approaches:

·        Specifyonly the paramName attribute - The named JSP bean (optionally scoped by the value of the paramScope attribute) mustidentify a value that can be converted to a String.

·        Specifyboth the paramName and paramProperty attributes - The specified property getter method will be called on the JSPbean identified by the paramName (and optional paramScope) attributes, in orderto select a value that can be converted to a String.

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

·        Specifyonly the name attribute - The named JSP bean (optionally scoped by the value of the scope attribute) mustidentify a java.util.Map containing the parameters.

·        Specifyboth name and property attributes - The specified property getter method will be called on the beanidentified by the name (and optional scope) attributes, in orderto return the java.util.Map containing the parameters.

As the Map is processed, the keysare assumed to be the names of query parameters to be appended to thehyperlink. The value associated with each key must be either a String or aString array representing the parameter value(s), or an object whose toString()method will be called. If a String array is specified, more than one value forthe same query parameter name will be created.

Additionally, you canrequest that the current transaction control token, if any, be included in thegenerated hyperlink by setting the transaction attribute to true. You can also requestthat an anchor ("#xxx") be added to the end of the URL that iscreated by any of the above mechanisms, by using the anchor attribute.

Attribute Name

Description

bundle

The servlet context attributes key for the MessageResources instance to use. If not specified, defaults to the application resources configured for our action servlet.

Since: Struts 1.2.5

[RT Expr]

action

Logical name of a global Action 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 action attribute, the forward attribute, the href attribute, or the page attribute.

Additionally, you can specify a module prefix for linking to other modules.

[RT Expr]

module

Prefix name of a Module that contains the action mapping for the Action that is specified by the action attribute. You must specify an action attribute for this to have an effect.

Note: Use "" to map to the default module.

[RT Expr]

anchor

Optional anchor tag ("#xxx") to be added to the generated hyperlink. Specify this value without any "#" character.

[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 action attribute, the forward attribute, the href attribute, or the page attribute.

[RT Expr]

frameborder

Should a frame border be generated around this frame (1) or not (0)?

[RT Expr]

frameName

Value for the name attribute of the rendered <frame> element.

[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 action attribute, the forward attribute, the href attribute, or the page attribute.

[RT Expr]

longdesc

URI of a long description of the frame. This description should supplement the short description provided by the title attribute, and may be particularly useful for non-visual user agents.

[RT Expr]

marginheight

The amount of space (in pixels) to be left between the frame's contents and its top and bottom margins.

[RT Expr]

marginwidth

The amount of space (in pixels) to be left between the frame's contents and its left and right margins.

[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]

noresize

Should users be disallowed from resizing the frame? (true, false).

[RT Expr]

page

The module-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 action attribute, the forward attribute, the href 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 attribute

[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]

scrolling

Should scroll bars be created unconditionally (yes), never (no), or only when needed (auto)?

[RT Expr]

style

CSS styles to be applied to this element.

[RT Expr]

styleClass

CSS stylesheet class to be applied to this HTML element (renders a "class" attribute). [RT Expr]

styleId

Identifier to be assigned to this HTML element (renders an "id" attribute). [RT Expr]

title

The advisory title for this element.

[RT Expr]

titleKey

The message resources key for the advisory title for this element.

[RT Expr]

transaction

If set to true, any current transaction control token will be included in the generated hyperlink, so that it will pass an isTokenValid() test in the receiving Action.

[RT Expr]

Back totop

hidden - Render A Hidden Field

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

Attribute Name

Description

accesskey

The keyboard character used to move focus immediately to this element. [RT Expr]

alt

The alternate text for this element.

[RT Expr]

altKey

The message resources key of the alternate text for this element.

[RT Expr]

bundle

The servlet context attributes key for the MessageResources instance to use. If not specified, defaults to the application resources configured for our action servlet.

Since: Struts 1.2.5

[RT Expr]

disabled

Set to true if this input field should be disabled. [RT Expr]

indexed

Valid only inside of logic:iterate tag. If true then name of the html tag will be rendered as "id[34].propertyName". Number in brackets will be generated for every iteration and taken from ancestor logic:iterate tag. [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 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]

style

CSS styles to be applied to this HTML element. [RT Expr]

styleClass

CSS stylesheet class to be applied to this HTML element (renders a "class" attribute). [RT Expr]

styleId

Identifier to be assigned to this HTML element (renders an "id" attribute). [RT Expr]

title

The advisory title for this element.

[RT Expr]

titleKey

The message resources key for the advisory title for this element.

[RT Expr]

value

Value to which this field should be initialized. [Use the corresponding bean property value] [RT Expr]

write

Should the value of this field also be rendered to the response page to make it visible, in addition to creating an HTML type="hidden" element? By default, only the hidden element is created. [RT Expr]

Back totop

html - Render an HTML <html> Element

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

Attribute Name

Description

lang

Renders a lang attribute with the locale stored in the user's session. If not found in the session, the language from the Accept-Language HTTP header is used. If still not found, the default language for the server is used.

Since: Struts 1.2

[RT Expr]

locale

Set to true in order to store a Locale in the session based on the current request's Accept-Language header (if any) if none has currently been set. This attribute will create a session if one does not already exist. The lang attribute is rendered with the appropriate language code.

DEPRECATED: Creating a session is undesirable for apps that don't support them. Use the lang attribute to achieve the same functionality without creating a session.

[RT Expr]

xhtml

Set to true in order to render xml:lang and xmlns attributes on the generated html element. This also causes all other html tags to render as XHTML 1.0 (the <html:xhtml/> tag has a similar purpose).

Since: Struts 1.1

[RT Expr]

Back totop

image - Render an input tag of type "image"

Renders an HTML <input>tag of type "image". The base URL for this image is calculateddirectly based on the value specified in the src or page attributes, orindirectly by looking up a message resource string based on the srcKey or pageKey attributes. You mustspecify exactly one of these attributes.

If you would like toobtain the coordinates of the mouse click that submitted this request, see theinformation below on the property attribute.

This tag is only validwhen nested inside a form tag body.

Attribute Name

Description

accesskey

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

[RT Expr]

align

The alignment option for this image.

DEPRECATED: The align attribute is deprecated in HTML 4.x. The suggested alternative is to use CSS. Please see http://www.w3.org/TR/REC-html40/struct/objects.html#h-13.7.4 for more details.

[RT Expr]

alt

The alternate text for this image.

[RT Expr]

altKey

The message resources key of the alternate text for this image.

[RT Expr]

border

The width (in pixels) of the border around this image.

[RT Expr]

bundle

The servlet context attribute key for the MessageResources instance to use. If not specified, defaults to the application resources configured for our action servlet.

[RT Expr]

disabled

Set to true if this input field should be disabled. [RT Expr]

indexed

Valid only inside of logic:iterate tag. If true then name of the html tag will be rendered as "propertyName[34]". Number in brackets will be generated for every iteration and taken from ancestor logic:iterate tag. [RT Expr]

locale

The session attribute key for the Locale used to select internationalized messages. If not specified, defaults to the Struts standard 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]

page

The module-relative path of the image for this input tag.

[RT Expr]

pageKey

The key of the message resources string specifying the module-relative path of the image for this input tag.

[RT Expr]

property

The property 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 property as a blank string (property="").

[RT Expr]

src

The source URL of the image for this input tag.

[RT Expr]

srcKey

The key of the message resources string specifying the source URL of the image for this input tag.

[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 (renders a "class" attribute). [RT Expr]

styleId

Identifier to be assigned to this HTML element (renders an "id" attribute). [RT Expr]

tabindex

The tab order (ascending positive integers) for this element. [RT Expr]

title

The advisory title for this element.

[RT Expr]

titleKey

The message resources key for the advisory title for this element.

[RT Expr]

value

The value that will be submitted if this image button is pressed.

[RT Expr]

Back totop

img - Render an HTML img tag

Renders an HTML <img> element with the imageat the specified URL. Like the link tag, URL rewriting will be appliedautomatically to the value specified in src, page, or action to maintain session state in the absence ofcookies. This will allow dynamic generation of an image where the contentdisplayed for this image will be taken from the attributes of this tag.

The base URL for thisimage is calculated directly based on the value specified in src, page, or action or page, or indirectly bylooking up a message resource string based on the srcKey or pageKey attributes. You mustspecify exactly one of these attributes.

Normally, the src, page, or action that you specify willbe left unchanged (other than URL rewriting if necessary). However, there aretwo ways you can append one or more dynamically defined query parameters to thesrc URL -- specify a single parameter with the paramId attribute (at itsassociated attributes to select the value), or specify the name (and optional property) attributes to select ajava.util.Map bean that contains one or more parameter ids and correspondingvalues.

To specify a singleparameter, use the paramId attribute to define the name of the requestparameter to be submitted. To specify the corresponding value, use one of thefollowing approaches:

·        Specifyonly the paramName attribute - The named JSP bean (optionally scoped by the value of the paramScope attribute) mustidentify a value that can be converted to a String.

·        Specifyboth the paramName and paramProperty attributes - The specified property getter will be called on the JSP beanidentified by the paramName (and optional paramScope) attributes, in orderto select a value that can be converted to a String.

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

·        Specifyonly the name attribute - The named JSP bean (optionally scoped by the value of the scope attribute) mustidentify a java.util.Map containing the parameters.

·        Specifyboth name and property attributes - The specified property getter method will be called on the beanidentified by the name (and optional scope) attributes, in orderto return the java.util.Map containing the parameters.

As the Map is processed, the keysare assumed to be the names of query parameters to be appended to the src URL. The valueassociated with each key must be either a String or a String array representingthe parameter value(s), or an object whose toString() method will be called. Ifa String array is specified, more than one value for the same query parametername will be created.

You can specify the alternatetext for this image (which most browsers display as pop-up text block when theuser hovers the mouse over this image) either directly, through the alt attribute, orindirectly from a message resources bundle, using the bundle and altKey attributes.

Attribute Name

Description

align

Where the image is aligned to. Can be one of the following attributes:

  • left - left justify, wrapping text on right
  • right -right justify, wrapping test on left
  • top - aligns the image with the top of the text on the same row
  • middle - aligns the image's vertical center with the text base line
  • bottom - aligns the image with the bottom of the text's base line
  • texttop - aligns the image's top with that of the text font on the same line
  • absmiddle - aligns the image's vertical center with the absolute center of the text
  • absbottom - aligns the image with the absolute bottom of the text font on the same row

[RT Expr]

alt

And alternative text to be displayed in browsers that don't support graphics. Also used often as type of context help over images.

[RT Expr]

altKey

The message resources key of the alternate text for this element.

[RT Expr]

border

The width of the border surrounding the image.

[RT Expr]

bundle

The servlet context attribute key for the MessageResources instance to use. If not specified, defaults to the application resources configured for our action servlet.

[RT Expr]

contextRelative

If set to "true", this "anchors" the image src at the application context rather than the module context when the 'page' attribute is used to specify an image path.

DEPRECATED:Use module attribute instead; will be removed in a release afer 1.2.0.

[RT Expr]

height

The height of the image being displayed. This parameter is very nice to specify (along with width) to help the browser render the page faster.

[RT Expr]

hspace

The amount of horizontal spacing between the icon and the text. The text may be in the same paragraph, or be wrapped around the image.

[RT Expr]

imageName

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

[RT Expr]

ismap

The name of the server-side map that this image belongs to.

[RT Expr]

locale

The name of the request or session Locale attribute used to look up internationalized messages.

[RT Expr]

lowsrc

An image for people with low resolution graphics cards.

DEPRECATED: This attribute is not defined in the HTML 4.01 spec and will be removed in a future version of Struts.

[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]

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]

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 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]

paramId

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

[RT Expr]

page

The module-relative path, starting with a slash, of the image to be displayed by this tag. The rendered URL for this image will automatically prepend the context path of this web application (in the same manner as the page attribute on the link tag works), in addition to any necessary URL rewriting. You must specify either the page attribute or the src attribute.

[RT Expr]

pageKey

The message key, in the message resources bundle named by the bundle attribute, of the String to be used as the module-relative path for this image.

[RT Expr]

action

The action, starting with a slash, that will render the image to be displayed by this tag. The rendered URL for this image will automatically prepend the context path of this web application (in the same manner as the action attribute on the link tag works), in addition to any necessary URL rewriting. You must specify the action, page attribute or the src attribute.

Additionally, you can specify a module prefix for linking to other modules.

[RT Expr]

module

Prefix name of a Module that contains the action mapping for the Action that is specified by the action attribute. You must specify an action attribute for this to have an effect.

Note: Use "" to map to the default module.

[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 src URL.

[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 src URL. 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]

src

The URL to which this image will be transferred from This image may be dynamically modified by the inclusion of query parameters, as described in the tag description. This value will be used unmodified (other than potential URL rewriting) as the value of the "src" attribute in the rendered tag. You must specify either the page attribute or the src attribute.

[RT Expr]

srcKey

The message key, in the message resources bundle named by the bundle attribute, of the String to be used as the URL of this image.

[RT Expr]

style

CSS styles to be applied to this element.

[RT Expr]

styleClass

CSS stylesheet class to be applied to this HTML element (renders a "class" attribute). [RT Expr]

styleId

Identifier to be assigned to this HTML element (renders an "id" attribute). [RT Expr]

title

The advisory title for this element.

[RT Expr]

titleKey

The message resources key for the advisory title for this element.

[RT Expr]

useLocalEncoding

If set to true, LocalCharacterEncoding will be used, that is, the characterEncoding set to the HttpServletResponse, as prefered character encoding rather than UTF-8, when URLEncoding is done on parameters of the URL.

[RT Expr]

usemap

The name of the map as defined within this page for mapping hot-spot areas of this image.

[RT Expr]

vspace

The amount of vertical spacing between the icon and the text, above and below.

[RT Expr]

width

The width of the image being displayed. This parameter is very nice to specify (along with height) to help the browser render the page faster.

[RT Expr]

Back totop

javascript - Render JavaScript validation based on the validation rulesloaded by the ValidatorPlugIn.

Render JavaScriptvalidation based on the validation rules loaded by the ValidatorPlugIn.The set of validation rules that should be generated is based on the formNameattribute passed in, which should match the name attribute of the form elementin the xml file.

The dynamicJavascriptand staticJavascript attributes default to true, but if dynamicJavascript isset to true and staticJavascript is set to false then only the dynamicJavaScript will be rendered. If dynamicJavascript is set to false and staticJavascript isset to true then only the static JavaScript will berendered which can then be put in separate JSP page so the browser can cachethe static JavaScript.

Attribute Name

Description

cdata

If set to "true" and XHTML has been enabled, the JavaScript will be wrapped in a CDATA section to prevent XML parsing. The default is "true" to comply with the W3C's recommendation.

Since: Struts 1.1

[RT Expr]

dynamicJavascript

Whether or not to render the dynamic JavaScript. Defaults to true.

formName

The key (form name) to retrieve a specific set of validation rules. If "dynamicJavascript" is set to true and formName is missing or is not recognized by the ValidatorPlugIn, a JspException will be thrown.

[RT Expr]

method

The alternate JavaScript method name to be used instead of the of the default. The default is 'validate' concatenated in front of the key (form name) passed in (ex: validateRegistrationForm).

[RT Expr]

page

The current page of a set of validation rules if the page attribute for the field element in the xml file is in use.

[RT Expr]

scriptLanguage

The <script> element will not contain a language attribute when this is set to false. The default is true but this property is ignored in XHTML mode.

Since: Struts 1.2

[RT Expr]

src

The src attribute's value when defining the html script element.

[RT Expr]

staticJavascript

Whether or not to render the static JavaScript. Defaults to true.

htmlComment

Whether or not to enclose the javascript with HTML comments. This attribute is ignored in XHTML mode because the script would be deleted by the XML parser. See the cdata attribute for details on hiding scripts from XML parsers. Defaults to true.

[RT Expr]

bundle

The servlet context attributes key for the MessageResources instance to use. If not specified, defaults to the application resources configured for our action servlet.

Since: Struts 1.2.7

[RT Expr]

Back totop

link - Render an HTML anchor or hyperlink

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

The base URL for thishyperlink 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 nameof a global ActionForward to be looked up, and use the module-relative orcontext-relative URI found there. If the forward is module-relative then itmust point to an action and NOT to a page.

·        action - Use the value of this attribute as the nameof a Action to be looked up, and use the module-relative or context-relativeURI found there.

·        href - Use the value of this attribute unchanged.

·        page - Use the value of this attribute as amodule-relative URI, and generate a server-relative URI by including thecontext path and module prefix.

Normally, the hyperlinkyou specify with one of the attributes described in the previous paragraph willbe left unchanged (other than URL rewriting if necessary). However, there aretwo ways you can append one or more dynamically defined query parameters to thehyperlink -- specify a single parameter with the paramId attribute (and itsassociated attributes to select the value), or specify the name (and optional property) attributes to select ajava.util.Map bean that contains one or more parameter ids and correspondingvalues.

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

·        Specifyonly the paramName attribute - The named JSP bean (optionally scoped by the value of the paramScope attribute) mustidentify a value that can be converted to a String.

·        Specifyboth the paramName and paramProperty attributes - The specified property getter method will be called on the JSPbean identified by the paramName (and optional paramScope) attributes, in orderto select a value that can be converted to a String.

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

·        Specifyonly the name attribute - The named JSP bean (optionally scoped by the value of the scope attribute) mustidentify a java.util.Map containing the parameters.

·        Specifyboth name and property attributes - The specified property getter method will be called on the beanidentified by the name (and optional scope) attributes, in orderto return the java.util.Map containing the parameters.

As the Map is processed, the keysare assumed to be the names of query parameters to be appended to thehyperlink. The value associated with each key must be either a String or aString array representing the parameter value(s), or an object whose toString()method will be called. If a String array is specified, more than one value forthe same query parameter name will be created.

Additionally, you canrequest that the current transaction control token, if any, be included in thegenerated hyperlink by setting the transaction attribute to true. You can also requestthat an anchor ("#xxx") be added to the end of the URL that iscreated by any of the above mechanisms, by using the anchor attribute.

Attribute Name

Description

accesskey

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

[RT Expr]

action

Logical name of a Action 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 action attribute, the forward attribute, the href attribute, the linkName attribute, or the page attribute.

Additionally, you can specify a module prefix for linking to other modules.

[RT Expr]

module

Prefix name of a Module that contains the action mapping for the Action that is specified by the action attribute. You must specify an action attribute for this to have an effect.

Note: Use "" to map to the default module.

[RT Expr]

anchor

Optional anchor tag ("#xxx") to be added to the generated hyperlink. Specify this value without any "#" character.

[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 action attribute, 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 action attribute, the forward attribute, the href attribute, the linkName attribute, or the page attribute.

[RT Expr]

indexed

Valid only inside of logic:iterate tag. If true then indexed parameter with name from indexId attribute will be added to the query string. Indexed parameter looks like "index[32]". Number in brackets will be generated for every iteration and taken from ancestor logic:iterate tag. [RT Expr]

indexId

By this attribute different name for the indexed parameter can be specified. Take a look to the "indexed" attribute for details. [RT Expr]

bundle

The servlet context attributes key for the MessageResources instance to use. If not specified, defaults to the application resources configured for our action servlet.

Since: Struts 1.2.5

[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 module-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 action attribute, 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 attribute

[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 HTML element (renders a "class" attribute). [RT Expr]

styleId

Identifier to be assigned to this HTML element (renders an "id" attribute). [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]

title

The advisory title for this hyperlink.

[RT Expr]

titleKey

The message resources key for the advisory title for this element.

[RT Expr]

transaction

If set to true, any current transaction control token will be included in the generated hyperlink, so that it will pass an isTokenValid() test in the receiving Action.

[RT Expr]

useLocalEncoding

If set to true, LocalCharacterEncoding will be used, that is, the characterEncoding set to the HttpServletResponse, as prefered character encoding rather than UTF-8, when URLEncoding is done on parameters of the URL.

[RT Expr]

Back totop

messages - Conditionally display a set of accumulated messages.

Displays a set ofmessages prepared by a business logic component and stored as an ActionMessagesobject, ActionErrors object, a String, or a String array in anyscope. If such a bean is not found, nothing will be rendered.

In order to use this tagsuccessfully, you must have defined an application scope MessageResourcesbean under the default attribute name.

Attribute Name

Description

id

The name of a page scope JSP bean that will contain the current element of the collection of messages on each iteration, if it is not null. [Required]

bundle

The servlet context attribute key for the MessageResources instance to use. If not specified, defaults to the application resources configured for our action servlet. [RT Expr]

locale

The session attribute key for the Locale used to select messages to be displayed. If not specified, defaults to the Struts standard value. [RT Expr]

name

Name of the bean in any scope under which our messages have been stored. If not present, the name specified by the Globals.ERROR_KEY constant string will be used. [RT Expr]

property

Name of the property for which messages should be displayed. If not specified, all messages (regardless of property) are displayed. [RT Expr]

header

This value is an optional message resource key that will be printed before the iteration of messages begins. [RT Expr]

footer

This value is an optional message resource key that will be printed after the iteration of messages has finished. [RT Expr]

message

By default the tag will retrieve the bean it will iterate over from the Globals.ERROR_KEY constant string, but if this attribute is set to 'true' the bean will be retrieved from the Globals.MESSAGE_KEY constant string. Also if this is set to 'true', any value assigned to the name attribute will be ignored. [RT Expr]

Back totop

multibox - Render A Checkbox Input Field

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

WARNING: In order to correctly recognize cases wherenone of the associated checkboxes are selected, the ActionForm bean associated withthis form must include a statement setting the corresponding array to zerolength in the reset() method.

The value to be returnedto the server, if this checkbox is selected, must be defined by one of thefollowing methods:

·        Specify a value attribute, whosecontents will be used literally as the value to be returned.

·        Specify no value attribute, and thenested body content of this tag will be used as the value to be returned.

Attribute Name

Description

accesskey

The keyboard character used to move focus immediately to this element. [RT Expr]

alt

The alternate text for this element.

[RT Expr]

altKey

The message resources key of the alternate text for this element.

[RT Expr]

bundle

The servlet context attributes key for the MessageResources instance to use. If not specified, defaults to the application resources configured for our action servlet.

Since: Struts 1.2.5

[RT Expr]

disabled

Set to true if this input field should be disabled. [RT Expr]

errorKey

Name of the request scope bean under which our error messages have been stored. If not present, the name specified by the Globals.ERROR_KEY constant string will be used.

N.B. This is used in conjunction with the errorStyle, errorStyleClass and errorStyleId attributes and should be set to the same value as the name attribute on the <html:errors/> tag.

Since: Struts 1.2.5

[RT Expr]

errorStyle

CSS styles to be applied to this HTML element if an error exists for it.

N.B. If present, this overrides the style attribute in the event of an error.

Since: Struts 1.2.5

[RT Expr]

errorStyleClass

CSS stylesheet class to be applied to this HTML element if an error exists for it (renders a "class" attribute).

N.B. If present, this overrides the styleClass attribute in the event of an error.

Since: Struts 1.2.5

[RT Expr]

errorStyleId

Identifier to be assigned to this HTML element if an error exists for it (renders an "id" attribute).

N.B. If present, this overrides the styleId attribute in the event of an error.

Since: Struts 1.2.5

[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.

N.B. If present, the errorStyle overrides this attribute in the event of an error for the element.

[RT Expr]

styleClass

CSS stylesheet class to be applied to this HTML element (renders a "class" attribute).

N.B. If present, the errorStyleClass overrides this attribute in the event of an error for the element.

[RT Expr]

styleId

Identifier to be assigned to this HTML element (renders an "id" attribute).

N.B. If present, the errorStyleId overrides this attribute in the event of an error for the element.

[RT Expr]

tabindex

The tab order (ascending positive integers) for this element. [RT Expr]

title

The advisory title for this element.

[RT Expr]

titleKey

The message resources key for the advisory title for this element.

[RT Expr]

value

The value to be transmitted if this checkbox is checked when the form is submitted. [RT Expr]

Back totop

option - Render A Select Option

Render an HTML <option>element, representing one of the choices for an enclosing <select>element. The text displayed to the user comes from either the body of this tag,or from a message string looked up based on the bundle, locale, and key attributes.

If the value of thecorresponding bean property matches the specified value, this option will bemarked selected. This tag is only valid when nested inside a <html:select> tag body.

Attribute Name

Description

bundle

The servlet context attributes key for the MessageResources instance to use. If not specified, defaults to the application resources configured for our action servlet. [RT Expr]

disabled

Set to true if this option should be disabled. [RT Expr]

key

If specified, defines the message key to be looked up in the resource bundle specified by bundle for the text displayed to the user for this option. If not specified, the text to be displayed is taken from the body content of this tag. [RT Expr]

locale

The session attributes key for the Locale instance to use for looking up the message specified by the key attribute. If not specified, uses the standard Struts session attribute name. [RT Expr]

style

CSS styles to be applied to this HTML element. [RT Expr]

styleId

Identifier to be assigned to this HTML element (renders an "id" attribute). [RT Expr]

styleClass

CSS stylesheet class to be applied to this HTML element (renders a "class" attribute). [RT Expr]

value

Value to be submitted for this field if this option is selected by the user. [Required] [RT Expr]

Back totop

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 <html:select> element, either in conjunction with or instead of one or more <html:option> or <html:optionsCollection> elements.

This tag operates in oneof two major modes, depending on whether or not the collection attribute is specified.If the collection attribute is included, the following rulesapply:

·        The collectionattribute is interpreted as the name of a JSP bean, in some scope, that itselfrepresents a collection of individual beans, one per option value to berendered.

·        The propertyattribute is interpreted as the name of a property of the individual beansincluded in the collection, and is used to retrieve the value that will bereturned to the server if this option is selected.

·        The labelPropertyattribute is interpreted as the name of a property of the individual beansincluded in the collection, and is used to retrieve the label that will bedisplayed to the user for this option. If the labelPropertyattribute is not specified, the property named by the property attribute will be usedto select both the value returned to the server and the label displayed to theuser for this option.

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

The collection of valuesactually selected depends on the presence or absence of the name and property attributes. Thefollowing combinations are allowed:

·        Onlyname is specified - The value of this attribute is the name of a JSP bean in somescope that is the collection.

·        Onlyproperty is specified - The value of this attribute is the name of a property of theActionForm bean associated with our form, which will return the collection.

·        Bothname 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 thatbean which will return the collection.

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

·        NeitherlabelName nor labelProperty is specified - The labels will be the same as the option values themselves.

·        OnlylabelName is specified - The value of this attribute is the name of a JSP bean in somescope that is the collection.

·        OnlylabelProperty is specified - The value of this attribute is the name of a property of theActionForm bean associated with our form, which will return the collection.

·        BothlabelName 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 thatbean which will return the collection.

Note that this tag doesnot support a styleId attribute, as it would have to apply the valueto all the option elements created by this element, which wouldmean that more than one id element might have the same value, which theHTML specification says is illegal.

Attribute Name

Description

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]

filter

Set to false if you do NOT want the option labels filtered for sensitive characters in HTML. By default, such values are filtered. [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]

style

CSS styles to be applied to this HTML element. [RT Expr]

styleClass

CSS stylesheet class to be applied to this HTML element (renders a "class" attribute). [RT Expr]

Back totop

optionsCollection - 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 <html:select> element, either in conjunction with or instead of one or more <html:option> or <html:options> elements.

This tag operates on acollection of beans, where each bean has a label property and a valueproperty. The actual names of these properties can be configured using the label and value attributes of this tag.

This tag differs fromthe <html:options> tag in that it makes more consistent use of thename and property attributes, and allows the collection to bemore easily obtained from the enclosing form bean.

Note that this tag doesnot support a styleId attribute, as it would have to apply the valueto all the option elements created by this element, which wouldmean that more than one id element might have the same value, which theHTML specification says is illegal.

Attribute Name

Description

filter

Set to false if you do NOT want the option labels filtered for sensitive characters in HTML. By default, such values are filtered. [RT Expr]

label

The property of the bean within the collection which represents the label to be rendered for each option. Defaults to "label". [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

The property of the form bean, or the bean specified by the name attribute, that will return the collection of objects to be rendered for these options. [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 (renders a "class" attribute). [RT Expr]

value

The property of the bean within the collection which represents the value to be rendered for each option. Defaults to "value". [RT Expr]

Back totop

password - Render A Password Input Field

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

Attribute Name

Description

accesskey

The keyboard character used to move focus immediately to this element. [RT Expr]

alt

The alternate text for this element.

[RT Expr]

altKey

The message resources key of the alternate text for this element.

[RT Expr]

bundle

The servlet context attributes key for the MessageResources instance to use. If not specified, defaults to the application resources configured for our action servlet.

Since: Struts 1.2.5

[RT Expr]

disabled

Set to true if this input field should be disabled. [RT Expr]

errorKey

Name of the request scope bean under which our error messages have been stored. If not present, the name specified by the Globals.ERROR_KEY constant string will be used.

N.B. This is used in conjunction with the errorStyle, errorStyleClass and errorStyleId attributes and should be set to the same value as the name attribute on the <html:errors/> tag.

Since: Struts 1.2.5

[RT Expr]

errorStyle

CSS styles to be applied to this HTML element if an error exists for it.

N.B. If present, this overrides the style attribute in the event of an error.

Since: Struts 1.2.5

[RT Expr]

errorStyleClass

CSS stylesheet class to be applied to this HTML element if an error exists for it (renders a "class" attribute).

N.B. If present, this overrides the styleClass attribute in the event of an error.

Since: Struts 1.2.5

[RT Expr]

errorStyleId

Identifier to be assigned to this HTML element if an error exists for it (renders an "id" attribute).

N.B. If present, this overrides the styleId attribute in the event of an error.

Since: Struts 1.2.5

[RT Expr]

indexed

Valid only inside of logic:iterate tag. If true then name of the html tag will be rendered as "id[34].propertyName". Number in brackets will be generated for every iteration and taken from ancestor logic:iterate tag. [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]

readonly

Set to true if this input field should be read only. [RT Expr]

redisplay

Boolean flag indicating whether or not existing values will be redisplayed if they exist. Even though the redisplayed value will be shown as asterisks on the visible HTML page, the cleartext of the actual password value will be visible though the "Show Page Source" menu option of the client browser. You may wish to set this value to false on login pages. Defaults to true for consistency with all other form tags that redisplay their contents. [RT Expr]

style

CSS styles to be applied to this HTML element.

N.B. If present, the errorStyle overrides this attribute in the event of an error for the element.

[RT Expr]

styleClass

CSS stylesheet class to be applied to this HTML element (renders a "class" attribute).

N.B. If present, the errorStyleClass overrides this attribute in the event of an error for the element.

[RT Expr]

styleId

Identifier to be assigned to this HTML element (renders an "id" attribute).

N.B. If present, the errorStyleId overrides this attribute in the event of an error for the 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]

title

The advisory title for this element.

[RT Expr]

titleKey

The message resources key for the advisory title 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)] [RT Expr]

Back totop

radio - Render A Radio Button Input Field

Renders an HTML<input> element of type radio, populated from the specified property ofthe bean associated with our current form. This tag is only valid when nestedinside a form tag body.

If an iterator is usedto render a series of radio tags, the idName attribute may be used to specifythe name of the bean exposed by the iterator. In this case, the value attributeis used as the name of a property on the idName bean that returns the value ofthe radio tag in this iteration.

Attribute Name

Description

accesskey

The keyboard character used to move focus immediately to this element. [RT Expr]

alt

The alternate text for this element.

[RT Expr]

altKey

The message resources key of the alternate text for this element.

[RT Expr]

bundle

The servlet context attributes key for the MessageResources instance to use. If not specified, defaults to the application resources configured for our action servlet.

Since: Struts 1.2.5

[RT Expr]

disabled

Set to true if this input field should be disabled. [RT Expr]

errorKey

Name of the request scope bean under which our error messages have been stored. If not present, the name specified by the Globals.ERROR_KEY constant string will be used.

N.B. This is used in conjunction with the errorStyle, errorStyleClass and errorStyleId attributes and should be set to the same value as the name attribute on the <html:errors/> tag.

Since: Struts 1.2.5

[RT Expr]

errorStyle

CSS styles to be applied to this HTML element if an error exists for it.

N.B. If present, this overrides the style attribute in the event of an error.

Since: Struts 1.2.5

[RT Expr]

errorStyleClass

CSS stylesheet class to be applied to this HTML element if an error exists for it (renders a "class" attribute).

N.B. If present, this overrides the styleClass attribute in the event of an error.

Since: Struts 1.2.5

[RT Expr]

errorStyleId

Identifier to be assigned to this HTML element if an error exists for it (renders an "id" attribute).

N.B. If present, this overrides the styleId attribute in the event of an error.

Since: Struts 1.2.5

[RT Expr]

indexed

Valid only inside of logic:iterate tag. If true then name of the html tag will be rendered as "id[34].propertyName". Number in brackets will be generated for every iteration and taken from ancestor logic:iterate tag. [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]

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.

N.B. If present, the errorStyle overrides this attribute in the event of an error for the element.

[RT Expr]

styleClass

CSS stylesheet class to be applied to this HTML element (renders a "class" attribute).

N.B. If present, the errorStyleClass overrides this attribute in the event of an error for the element.

[RT Expr]

styleId

Identifier to be assigned to this HTML element (renders an "id" attribute).

N.B. If present, the errorStyleId overrides this attribute in the event of an error for the element.

[RT Expr]

tabindex

The tab order (ascending positive integers) for this element. [RT Expr]

title

The advisory title for this element.

[RT Expr]

titleKey

The message resources key for the advisory title for this element.

[RT Expr]

value

The value of the radio tag. [Required] [RT Expr]

idName

Name of the bean (in some scope) that will return the value of the radio tag. Usually exposed by an iterator. When the idName attribute is present, the value attribute is used as the name of the property on the idName bean that will return the value of the radio tag for this iteration.

Since: Struts 1.1

[RT Expr]

Back totop

reset - Render A Reset Button Input Field

Renders an HTML<input> element of type reset.

Attribute Name

Description

accesskey

The keyboard character used to move focus immediately to this element. [RT Expr]

alt

The alternate text for this element.

[RT Expr]

altKey

The message resources key of the alternate text for this element.

[RT Expr]

bundle

The servlet context attributes key for the MessageResources instance to use. If not specified, defaults to the application resources configured for our action servlet.

Since: Struts 1.2.5

[RT Expr]

disabled

Set to true if this input field should be disabled. [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 input field that will be generated. [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 (renders a "class" attribute). [RT Expr]

styleId

Identifier to be assigned to this HTML element (renders an "id" attribute). [RT Expr]

tabindex

The tab order (ascending positive integers) for this element. [RT Expr]

title

The advisory title for this element.

[RT Expr]

titleKey

The message resources key for the advisory title for this element.

[RT Expr]

value

Value of the label to be placed on this button. [Body of this tag (if any), or "Reset"] [RT Expr]

Back totop

rewrite - Render an URI

Renders a request URIbased on exactly the same rules as the link tag does, but without creating the <a> hyperlink. This valueis useful when you want to generate a string constant for use by a JavaScriptprocedure.

Attribute Name

Description

action

Logical name of a Action 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 action attribute, the forward attribute, the href attribute, or the page attribute.

Additionally, you can specify a module prefix for linking to other modules.

Since: Struts 1.2.0

[RT Expr]

module

Prefix name of a Module that contains the action mapping for the Action that is specified by the action attribute. You must specify an action attribute for this to have an effect.

Note: Use "" to map to the default module.

[RT Expr]

anchor

Optional anchor tag ("#xxx") to be added to the generated hyperlink. Specify this value without any "#" character.

[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 action attribute, 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 action attribute, 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]

page

The module-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 action attribute, the forward attribute, the href 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 attribute

[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]

transaction

If set to true, any current transaction control token will be included in the generated hyperlink, so that it will pass an isTokenValid() test in the receiving Action.

[RT Expr]

useLocalEncoding

If set to true, LocalCharacterEncoding will be used, that is, the characterEncoding set to the HttpServletResponse, as prefered character encoding rather than UTF-8, when URLEncoding is done on parameters of the URL.

[RT Expr]

Back totop

select - Render A Select Element

Renders an HTML <select>element, associated with a bean property specified by our attributes. This tagis only valid when nested inside a form tag body.

This tag operates in twomodes, depending upon the state of the multiple attribute, which affects the data type of theassociated property you should use:

·        multiple="true"IS NOT selected - The correspondingproperty should be a scalar value of any supported data type.

·        multiple="true"IS selected - The correspondingproperty should be an array of any supported data type.

WARNING: In order to correctly recognize cases where noselection at all is made, the ActionForm bean associated with this form must include astatement resetting the scalar property to a default value (if multiple is not set), or thearray property to zero length (if multiple is set) in the reset() method.

Attribute Name

Description

alt

The alternate text for this element.

[RT Expr]

altKey

The message resources key of the alternate text for this element.

[RT Expr]

bundle

The servlet context attributes key for the MessageResources instance to use. If not specified, defaults to the application resources configured for our action servlet.

Since: Struts 1.2.5

[RT Expr]

disabled

Set to true if this input field should be disabled. [RT Expr]

errorKey

Name of the request scope bean under which our error messages have been stored. If not present, the name specified by the Globals.ERROR_KEY constant string will be used.

N.B. This is used in conjunction with the errorStyle, errorStyleClass and errorStyleId attributes and should be set to the same value as the name attribute on the <html:errors/> tag.

Since: Struts 1.2.5

[RT Expr]

errorStyle

CSS styles to be applied to this HTML element if an error exists for it.

N.B. If present, this overrides the style attribute in the event of an error.

Since: Struts 1.2.5

[RT Expr]

errorStyleClass

CSS stylesheet class to be applied to this HTML element if an error exists for it (renders a "class" attribute).

N.B. If present, this overrides the styleClass attribute in the event of an error.

Since: Struts 1.2.5

[RT Expr]

errorStyleId

Identifier to be assigned to this HTML element if an error exists for it (renders an "id" attribute).

N.B. If present, this overrides the styleId attribute in the event of an error.

Since: Struts 1.2.5

[RT Expr]

indexed

Valid only inside of logic:iterate tag. If true then name of the html tag will be rendered as "id[34].propertyName". Number in brackets will be generated for every iteration and taken from ancestor logic:iterate tag. [RT Expr]

multiple

If set to any arbitrary value, the rendered select element will support multiple selections. [RT Expr]

name

The attribute name of the bean whose properties are consulted to determine which option should be pre-selected when rendering this input field. If not specified, the bean associated with the enclosing <html:form> tag 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.

N.B. If present, the errorStyle overrides this attribute in the event of an error for the element.

[RT Expr]

styleClass

CSS stylesheet class to be applied to this HTML element (renders a "class" attribute).

N.B. If present, the errorStyleClass overrides this attribute in the event of an error for the element.

[RT Expr]

styleId

Identifier to be assigned to this HTML element (renders an "id" attribute).

N.B. If present, the errorStyleId overrides this attribute in the event of an error for the 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]

title

The advisory title for this element.

[RT Expr]

titleKey

The message resources key for the advisory title for this element.

[RT Expr]

value

The value to compare with for marking an option selected. [RT Expr]

Back totop

submit - Render A Submit Button

Renders an HTML<input> element of type submit.

If a graphical button isneeded (a button with an image), then the image tag is moreappropriate.

Attribute Name

Description

accesskey

The keyboard character used to move focus immediately to this element. [RT Expr]

alt

The alternate text for this element.

[RT Expr]

altKey

The message resources key of the alternate text for this element.

[RT Expr]

bundle

The servlet context attributes key for the MessageResources instance to use. If not specified, defaults to the application resources configured for our action servlet.

Since: Struts 1.2.5

[RT Expr]

disabled

Set to true if this input field should be disabled. [RT Expr]

indexed

Valid only inside of logic:iterate tag. If true then name of the html tag will be rendered as "propertyName[34]". Number in brackets will be generated for every iteration and taken from ancestor logic:iterate tag. [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 (renders a "class" attribute). [RT Expr]

styleId

Identifier to be assigned to this HTML element (renders an "id" attribute). [RT Expr]

tabindex

The tab order (ascending positive integers) for this element. [RT Expr]

title

The advisory title for this element.

[RT Expr]

titleKey

The message resources key for the advisory title for this element.

[RT Expr]

value

The value of the button label. [RT Expr]

Back totop

text - Render An Input Field of Type text

Render an input buttonof type text. This tag is only valid when nested inside a form tag body.

Attribute Name

Description

accesskey

The keyboard character used to move focus immediately to this element. [RT Expr]

alt

The alternate text for this element.

[RT Expr]

altKey

The message resources key of the alternate text for this element.

[RT Expr]

bundle

The servlet context attributes key for the MessageResources instance to use. If not specified, defaults to the application resources configured for our action servlet.

Since: Struts 1.2.5

[RT Expr]

disabled

Set to true if this input field should be disabled. [RT Expr]

errorKey

Name of the request scope bean under which our error messages have been stored. If not present, the name specified by the Globals.ERROR_KEY constant string will be used.

N.B. This is used in conjunction with the errorStyle, errorStyleClass and errorStyleId attributes and should be set to the same value as the name attribute on the <html:errors/> tag.

Since: Struts 1.2.5

[RT Expr]

errorStyle

CSS styles to be applied to this HTML element if an error exists for it.

N.B. If present, this overrides the style attribute in the event of an error.

Since: Struts 1.2.5

[RT Expr]

errorStyleClass

CSS stylesheet class to be applied to this HTML element if an error exists for it (renders a "class" attribute).

N.B. If present, this overrides the styleClass attribute in the event of an error.

Since: Struts 1.2.5

[RT Expr]

errorStyleId

Identifier to be assigned to this HTML element if an error exists for it (renders an "id" attribute).

N.B. If present, this overrides the styleId attribute in the event of an error.

Since: Struts 1.2.5

[RT Expr]

indexed

Valid only inside of logic:iterate tag. If true then name of the html tag will be rendered as "id[34].propertyName". Number in brackets will be generated for every iteration and taken from ancestor logic:iterate tag. [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 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]

readonly

Set to true if this input field should be read only. [RT Expr]

size

Number of character positions to allocate. [Browser default] [RT Expr]

style

CSS styles to be applied to this HTML element.

N.B. If present, the errorStyle overrides this attribute in the event of an error for the element.

[RT Expr]

styleClass

CSS stylesheet class to be applied to this HTML element (renders a "class" attribute).

N.B. If present, the errorStyleClass overrides this attribute in the event of an error for the element.

[RT Expr]

styleId

Identifier to be assigned to this HTML element (renders an "id" attribute).

N.B. If present, the errorStyleId overrides this attribute in the event of an error for the element.

[RT Expr]

tabindex

The tab order (ascending positive integers) for this element. [RT Expr]

title

The advisory title for this element.

[RT Expr]

titleKey

The message resources key for the advisory title for this element.

[RT Expr]

value

Value to which this field should be initialized. [Use the corresponding bean property value] [RT Expr]

Back totop

textarea - Render A Textarea

Render a textareaelement. This tag is only valid when nested inside a form tag body.

Attribute Name

Description

accesskey

The keyboard character used to move focus immediately to this element. [RT Expr]

alt

The alternate text for this element.

[RT Expr]

altKey

The message resources key of the alternate text for this element.

[RT Expr]

bundle

The servlet context attributes key for the MessageResources instance to use. If not specified, defaults to the application resources configured for our action servlet.

Since: Struts 1.2.5

[RT Expr]

cols

The number of columns to display. [RT Expr]

disabled

Set to true if this input field should be disabled. [RT Expr]

errorKey

Name of the request scope bean under which our error messages have been stored. If not present, the name specified by the Globals.ERROR_KEY constant string will be used.

N.B. This is used in conjunction with the errorStyle, errorStyleClass and errorStyleId attributes and should be set to the same value as the name attribute on the <html:errors/> tag.

Since: Struts 1.2.5

[RT Expr]

errorStyle

CSS styles to be applied to this HTML element if an error exists for it.

N.B. If present, this overrides the style attribute in the event of an error.

Since: Struts 1.2.5

[RT Expr]

errorStyleClass

CSS stylesheet class to be applied to this HTML element if an error exists for it (renders a "class" attribute).

N.B. If present, this overrides the styleClass attribute in the event of an error.

Since: Struts 1.2.5

[RT Expr]

errorStyleId

Identifier to be assigned to this HTML element if an error exists for it (renders an "id" attribute).

N.B. If present, this overrides the styleId attribute in the event of an error.

Since: Struts 1.2.5

[RT Expr]

indexed

Valid only inside of logic:iterate tag. If true then name of the html tag will be rendered as "id[34].propertyName". Number in brackets will be generated for every iteration and taken from ancestor logic:iterate tag. [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 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]

readonly

Set to true if this input field should be read only. [RT Expr]

rows

The number of rows to display. [RT Expr]

style

CSS styles to be applied to this HTML element.

N.B. If present, the errorStyle overrides this attribute in the event of an error for the element.

[RT Expr]

styleClass

CSS stylesheet class to be applied to this HTML element (renders a "class" attribute).

N.B. If present, the errorStyleClass overrides this attribute in the event of an error for the element.

[RT Expr]

styleId

Identifier to be assigned to this HTML element (renders an "id" attribute).

N.B. If present, the errorStyleId overrides this attribute in the event of an error for the element.

[RT Expr]

tabindex

The tab order (ascending positive integers) for this element. [RT Expr]

title

The advisory title for this element.

[RT Expr]

titleKey

The message resources key for the advisory title for this element.

[RT Expr]

value

Value to which this field should be initialized. [Use the corresponding bean property value] [RT Expr]

Back totop

xhtml - Render HTML tags as XHTML

Using this tag in a pagetells all other html taglib tags to render themselves as XHTML 1.0. This isuseful when composing pages with JSP includes or Tiles. <html:htmlxhtml="true"> has a similar effect. This tag has no attributes;you use it like this: <html:xhtml/>.

Note: Included pages do not inherit the renderingstyle of the including page. Each JSP fragment or Tile must use this tag torender as XHTML.

Back totop

 


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值