Matthias,

form-bean is just a convenient way to map a name
with a class, so that in several 'action' definitions,
you can use the same value for the 'name' attribute.
That's why both 'formClass' attribute of the 'action'
tag has been deprecated.

So, when ActionServlet is trying to locate an appropriate
instance of ActionForm, it first searches for ActionForm
instances in the request/session space are done using the
'action.attribute' key.  If that search fails, then the
'action.name' key is used to lookup the appropriate
name-className mapping from the collection of form-beans.
When the className is retrieved (and loaded), an new
ActionForm instance is created and saved in request/session
space.

- Gidado

> -----Original Message-----
> From: Matthias Kerkhoff [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, November 16, 2000 12:11 PM
> To: [EMAIL PROTECTED]
> Subject: Need some help with struts-config.xml
> 
>[...]
> 
> - <action name=... attribute=... scope=... > with
> 
>       name - Name of the form bean, if any, that is associated
>              with this action.
> 
>[...] 
> ... is action.name a reference to form-bean.name ?
>

The API doc for ...struts.action.ActionMapping, gives this
description for the deprecated 'formClass' attribute:

    formClass - Fully qualified Java class name of the ActionForm
      implementation class used by this mapping (if any).
      DEPRECATED - use the name attribute to look up the
      corresponding ActionFormBean information.

So 'name' points to a form-bean.

> 
>  attribute - Name of the request-scope or session-scope attribute
>              under which our form bean is accessed, if it is other
>              than the bean's specified "name".  Optional if
>              name" is specified, else not allowed.
> 

'attribute' is the key for looking up particular ActionForm instances
in the the request/session space.

So it is supposed to match form-bean.name, and tests confirm.

- Gidado

Reply via email to