bean:struts

 < Day Day Up > 



<bean:struts />

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.

Table 20.10: <bean:struts /> Tag Attributes

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)

start sidebar

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.

end sidebar

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 > 



Professional Jakarta Struts
Professional Jakarta Struts (Programmer to Programmer)
ISBN: 0764544373
EAN: 2147483647
Year: 2003
Pages: 183

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