struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Niall Pemberton" <niall.pember...@gmail.com>
Subject Re: LazyValidatorForm FormFile instantiation exception
Date Tue, 21 Mar 2006 19:54:21 GMT
The basic LazyDynaBean implementation tried to be smart about
instantiating objects - so that people's regular POJO beans would get
automtaically created. In hindsight IMO this was a mistake. It is
however easy to remedy - by overriding the createOtherProperty()
method - see the "4. Automatic Property Instantiation" section here:

http://www.niallp.pwp.blueyonder.co.uk/lazydynabean.html

So if you want you can create a custom LazyDynaBean with this
behaviour. However, if you want this in LazyValidatorForm - you'll
then need to plug that DynaBean implementation into your own
LazyValidatorForm implementation - which is also pretty straight
forward:

http://www.niallp.pwp.blueyonder.co.uk/lazyactionform.html#section4

Niall

On 3/21/06, David Durham <ddurham@vailsys.com> wrote:
> Hi,
>
> I've got a form-bean definition like so:
>
>     <form-bean name="UploadForm"
>        type="org.apache.struts.validator.LazyValidatorForm">
>          <form-property name="file"
>            type="org.apache.struts.upload.FormFile"/>
>      ...
>     </form-bean>
>
> When I load the page the first time, I get an instantiation exception:
>
>    java.lang.InstantiationException: org.apache.struts.upload.FormFile
>
> It doesn't seriously affect the application, but I'm curious about the
> solution to this problem.  I searched the user@struts archives but
> didn't find this issue referenced.  Is there some way to set an inital
> value to null?  Maybe that would solve the problem?
>
> Thanks,
>
> Dave

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


Mime
View raw message