Jiri,

Your error message explains the problem properly: "No destination bean
specified". This means that BeanUtils.copyProperties is trying to copy the
registerDTO to a bean named 'form', which is null.  This makes complete
sense since your previous emails never tell us you've fixed your
<action.../> tag to include the 'name="someFormBeanName"' parameter.  You
need to switch your action tag to define a formBean. So, instead of having:

<action
            path="/Register2"
            type="cz.chalu.struts.modules.completeregister.LoadDataAction"
            parameter=".main.registerFinish"/>

You should have something like:

<action
            path="/Register2"
                name="registerFull"
            type="cz.chalu.struts.modules.completeregister.LoadDataAction"
            parameter=".main.registerFinish"/>

Without the name="registerFull" (or some other defined bean name), the
ActionForm named 'form' in the execute(...) method will always be undefined
or null, and therefore unusable:

public ActionForward execute(ActionMapping mapping,
        ActionForm form,        HttpServletRequest request,
        HttpServletResponse response) throws Exception, DatabaseException
{
// 'form' is in this function unless the action has
'name="someFormBeanName"' in it.
.....
}

Regards,
David

-----Original Message-----
From: Jiri Chaloupka [mailto:[EMAIL PROTECTED]
Sent: Sunday, August 31, 2003 12:24 PM
To: Struts Users Mailing List
Subject: Re: load data from db into form


Yes, nested tags, I must look at ...
so now I have it without nested, form definition is now without it.

but still I got

java.lang.IllegalArgumentException: No destination bean specified
        at
org.apache.commons.beanutils.BeanUtils.copyProperties(BeanUtils.java:220)
        at
cz.chalu.struts.modules.completeregister.LoadDataAction.execute(LoadDataActi
on.java:32)

What is missing? I my action class (execute method) I have:

public ActionForward execute(...){
LoadDataService service = new LoadDataService();
ComplRegisterDTO registerDTO = service.loadUser(request);
BeanUtils.copyProperties(form, registerDTO);
return null;
}

If I understand well, in BeanUtils.copyProperties I copy data from DTO
into form defined in execute method?
Or something other is wrong?

Thanks


Mark Lowe wrote:

> Okay assuming the following..
>
> <form-bean name="registerFull"
> type="org.apache.struts.validator.DynaValidatorForm">
>              <form-property name="id" type="java.lang.Integer" />
>            <form-property name="fullname" type="java.lang.String" />
>             <form-property name="notify" type="java.lang.Integer" />
> </form-bean>
>
> ..
>
> <html:text property="fullname" />
> <html:text property="id" />
> <html:text property="notify />
>
> or if you are nesting you bean which in that case i wouldn't (too short).
>
> <form-property name="mybean"
> type="cz.chalu.struts.modules.completeregister.ComplRegisterDTO">
>
> Then assuming that fullname, id, and notify are all properties of
> ComplRegisterDTO.
>
> <html:text property="mybean.fullname" />
> <html:text property="mybean.id" />
> <html:text property="mybean.notify" />
>
> Cheers Mark
>
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to