In an action that uses the form bean you want to replace, you can do
something like this:

if ("request".equals(mapping.getScope()))
    request.setAttribute(mapping.getAttribute(), form);
else
    request.getSession().setAttribute(mapping.getAttribute(), form);

This assumes that the new form bean is of the same class as the one being
replaced/the one struts instantiated for you.  Otherwise you could copy the
properties from bean to bean, manually or with BeanUtils.

- Paul
----- Original Message -----
From: "Jake Thompson" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, October 20, 2001 5:11 AM
Subject: Replacing the Form in an Action


> Hi all,
>
> I cannot seem to figure out what I need to do in order to replace the form
in the current scope with a newly created one.
>
> I have an action and I can get a form object fully populated for me, so I
want to do something like:
>
> form = newForm;
>
> however this obviously does not work.
>
> Can someone help me here, using 1.0
>
> Thanks,
> Jake T.
>
>
>
>

Reply via email to