| < Day Day Up > |
|
In this section, we discuss the sub-elements available to the top-level Struts components. Not all of these elements are used by each top-level component, but they are available to further describe each of them.
The <icon> sub-element contains <small-icon> and <large-icon> sub-elements that can be used to graphically represent its parent element in a Struts development tool. The syntax of the <icon> sub-element is:
<icon> <small-icon> path to somegraphicsfile (16x16 pixels) </small-icon> <large-icon> somelargergraphicsfile (32x32 pixels) </large-icon> </icon>
Table 15.1 describes the properties of an <icon> element.
Property | Description |
---|---|
<small-icon> | The <small-icon> sub-element contains a path, relative to the location of the Struts configuration file, naming a graphics file that contains a 16x16-pixel iconic image. |
<large-icon> | The <large-icon> sub-element contains a path, relative the location of the Struts configuration file, naming a graphics file that contains a 32x32-pixel iconic image. |
The following code snippets uses these <icon> sub-elements:
<icon> <small-icon> /images/smalllogo.gif </small-icon> <large-icon> /images/largelogo.gif </large-icon> </icon>
Note that the images referenced in these sub-elements are made strictly for Struts development and configuration tools. They are not intended for client-side display.
The <display-name> sub-element contains a short text description of its parent element for use in a Struts development tool. The syntax of the <display-name> sub-element is:
<display-name> short text discription of its parent element </display-name>
The <description> sub-element contains a full-length text description of its parent element for use in a Struts development tool. The syntax of the <description> sub-element is:
<description> full-length text discription of its parent element </description>
You can use the <set-property> sub-element to set the value of additional JavaBean properties of objects described by the <set-property> sub-element's parent. The <set-property> sub-element is commonly used to set GenericDataSource properties, extended ActionMappings, and extended global forwards. The syntax of the <set-property> sub-element is:
<set-property property="name of bean property" value="value of bean property" />
Table 15.2 describes the attributes of a <set-property> element.
Property | Description |
---|---|
property | The property of the JavaBeans property whose setter method will be called. (required) |
value | The large-icon String representation of the value to which this property will be set after suitable type conversion. (required) |
Here's an example that uses the <set-property> sub-element:
<set-property property="driverClass" value="org.gjt.mm.mysql.Driver" />
The <set-property> sub-element contains no body. It is configured using only its two attributes.
| < Day Day Up > |
|