struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From micael <caraun...@harbornet.com>
Subject Re: NullPointerException while extending DynaValidatorForm
Date Tue, 10 Sep 2002 17:43:56 GMT
You are not initializing a variable for an object.  I know that is rather 
obvious, but sometimes the obvious helps.  I hope it does here.

At 09:53 AM 9/10/2002 -0400, you wrote:
>Hi all,
>
>I have a problem setting values of a form in my action.
>The form extends the "org.apache.struts.validator.DynaValidatorForm". The 
>struts-config.xml defines all the properties of the form except 2, that 
>are defined in the actual Java source of the form.
>
>This is the error I'm getting :
>
>java.lang.NullPointerException
>         at 
> org.apache.struts.action.DynaActionForm.getDynaProperty(DynaActionForm.java:551)
>
>
>In struts config I have :
>
>    <form-bean name="CustomerForm" type="com.forms.CustomerForm">
>        <form-property name="cid" type="java.lang.String"/>
>    </form-bean>
>
>The action is trying to set the property of the form :
>
>form = new CustomerForm();
>CustomerForm cf = (CustomerForm) form;
>cf.set("cid", customer.getCid()); // THIS iS WHERE IT ERRORS OUT.
>
>
>
>Any ideas what I'm doing wrong ?
>
>Jf
>
>
>--
>To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
>For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>
>



--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>


Mime
View raw message