struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Niall Pemberton" <>
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:

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


On 3/21/06, David Durham <> 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:
For additional commands, e-mail:

View raw message