| < Day Day Up > |
|
The <bean:struts /> tag is used to copy a specified Struts internal component into a paged scoped scripting variable. The Struts components that can be retrieved include a FormBean, a forward, or a mapping object. The <bean:struts /> tag has no body and supports four attributes, as shown in Table 20.10.
Attribute | Description |
---|---|
id | Specifies the scripting variable used to store the retrieved Struts component. (Required) |
formBean | Specifies the Struts ActionFormBean object to be copied into the named scripting variable. (Optional) |
forward | Specifies the Struts ActionFormBean object to be copied into the named scripting variable. (Optional) |
mapping | Contains the path of the Struts ActionMapping object to be copied into the named scripting variable. (Optional) |
The forward and mapping attributes for the <bean:struts /> tag are mutually exclusive: you can only use one of the attributes for any single <bean:struts /> tag instance.
Here's an example of how we can use the <bean:struts /> tag:
<bean:struts formBean="UserForm"/>
In this example, we retrieve a UserForm FormBean, as it is described by the struts-config.xml file, and store a reference to it in the scripting variable userForm.
| < Day Day Up > |
|