Hi guys,
could be many whys, but it looks like your form bean is null. have you configured your struts-config mapping correctly to reference this form?


You should also cast the form bean into the type of form class you have specified, since it is passed into the action as the super class ActionForm.

Adam

On 08/31/2003 06:24 PM Jiri Chaloupka wrote:
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(LoadDataAction.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]



-- struts 1.1 + tomcat 4.1.27 + java 1.4.2 Linux 2.4.20 RH9


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



Reply via email to