struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <craig...@apache.org>
Subject Re: NPE when setting values on DynaActionForm
Date Tue, 23 Jul 2002 15:16:07 GMT


On Tue, 23 Jul 2002, Matt Raible wrote:

> Date: Tue, 23 Jul 2002 07:15:33 -0700 (PDT)
> From: Matt Raible <matt_raible@yahoo.com>
> Reply-To: Struts Developers List <struts-dev@jakarta.apache.org>,
>      matt.raible@icsynergy.com
> To: Struts Developers List <struts-dev@jakarta.apache.org>
> Subject: Re: NPE when setting values on DynaActionForm
>
> The call below results in:
>
>     [javac]                                        <-------------
>     [javac]     85.                 DynaActionForm requestForm =
>     [javac]     86.
> DynaActionFormClass.getDynaActionFormClass("requestForm").newInstance();
>     [javac]
> ------------------------------------------------------------------------------------------>
>     [javac] *** Error: The type of the left-hand side in this assignment,
> "org/apache/struts/action/DynaActionForm", is
> not compatible with the type of the right-hand side expression,
> "org/apache/commons/beanutils/DynaBean".
>
> BUILD FAILED
>
> However, this seems to work:
>
> DynaActionForm requestForm = (DynaActionForm)
>     DynaActionFormClass.getDynaActionFormClass("requestForm").newInstance();
>

You're right ... you do need the cast.  Sorry about that -- all I can do
is plead "late night" ...

Craig


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


Mime
View raw message