Chapter 14: The Bean Tag Library


Common Tag Attributes

As mentioned earlier, many of the tags in this library have several attributes in common. They are described in the following table.

Attribute

Description

Accepts JSP Expression

Required

accesskey

Same as the corresponding HTML tag's attribute with the same name.

Specifies the keyboard key that causes this control to immediately receive focus when the key is pressed.

Yes

No

alt

Same as the corresponding HTML tag's attribute with the same name.

Specifies the alternate text for this control.

Yes

No

altKey

Specifies a key from the application resource bundle whose value will be used to set the corresponding HTML tag's alt attribute.

Yes

No

bundle

Specifies the logical name of a resource bundle that will be used when looking up message keys specified by other attributes of this tag (e.g., altKey). The referenced resource bundle must be defined in the application's Struts configuration file.

Yes

No

disabled

Same as the corresponding HTML tag's attribute with the same name.

Accepts true or false to specify whether the control will be disabled, preventing its use.

Defaults to false.

Yes

No

indexed

Accepts true or false to specify whether the value assigned to the corresponding HTML tag's name attribute will have an index (e.g., "name[x].property").

This attribute is applicable only when this tag is nested inside the Logic Tag Library's iterate tag.

Defaults to false.

Yes

No

onblur

Same as the corresponding HTML tag's attribute with the same name.

Specifies the JavaScript code to execute when this control loses input focus.

Yes

No

onchange

Same as the corresponding HTML tag's attribute with the same name.

Specifies the JavaScript code to execute when this control loses input focus and its value has changed.

Yes

No

onclick

Same as the corresponding HTML tag's attribute with the same name.

Specifies the JavaScript code to execute when this control receives a mouse click.

Yes

No

ondblclick

Same as the corresponding HTML tag's attribute with the same name.

Specifies the JavaScript code to execute when this control receives a mouse double-click.

Yes

No

onfocus

Same as the corresponding HTML tag's attribute with the same name.

Specifies the JavaScript code to execute when this control receives input focus.

Yes

No

onkeydown

Same as the corresponding HTML tag's attribute with the same name.

Specifies the JavaScript code to execute when this control has focus and a key is pressed.

Yes

No

onkeypress

Same as the corresponding HTML tag's attribute with the same name.

Specifies the JavaScript code to execute when this control has focus and a key is pressed and released.

Yes

No

onkeyup

Same as the corresponding HTML tag's attribute with the same name.

Specifies the JavaScript code to execute when this control has focus and a key is released.

Yes

No

onmousedown

Same as the corresponding HTML tag's attribute with the same name.

Specifies the JavaScript code to execute when this control is under the mouse pointer and a mouse button is pressed.

Yes

No

onmousemove

Same as the corresponding HTML tag's attribute with the same name.

Specifies the JavaScript code to execute when this control is under the mouse pointer and the mouse is moved.

Yes

No

onmouseout

Same as the corresponding HTML tag's attribute with the same name.Specifies the JavaScript code to execute when this control is under the mouse pointer and is then moved away from the control.

Yes

No

onmouseover

Same as the corresponding HTML tag's attribute with the same name.

Specifies the JavaScript code to execute when this control is not under the mouse pointer and is then moved to the control.

Yes

No

onmouseup

Same as the corresponding HTML tag's attribute with the same name.

Specifies the JavaScript code to execute when this control is under the mouse pointer and a mouse button is released.

Yes

No

style

Same as the corresponding HTML tag's attribute with the same name.

Specifies the CSS style to apply to this control.

Yes

No

styleClass

Same as the corresponding HTML tag's class attribute.

Specifies the CSS class to apply to this control.

Yes

No

styleId

Same as the corresponding HTML tag's id attribute.

Specifies the CSS ID to apply to this control.

Yes

No

tabindex

Same as the corresponding HTML tag's attribute with the same name.

Specifies the tab order for this control.

Yes

No

title

Same as the corresponding HTML tag's attribute with the same name.

Specifies the title for this control.

Yes

No

titleKey

Specifies a key from the application resource bundle whose value will be used to set the corresponding HTML tag's title attribute.

Yes

No



Struts. The Complete Reference
Struts: The Complete Reference, 2nd Edition
ISBN: 0072263865
EAN: 2147483647
Year: 2004
Pages: 165
Authors: James Holmes

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net