If you wanted to have Struts use different flavours of BeanValidatorForm to
wrap objects then you would have to create your own custom FormBeanConfig
implementation and override the createActionForm() method. Then you need to
configure struts to use the custom FormBeanConfig and put in place a
mechanism to tell your custom FormBeanConfig how to select the various
flavours.

IMO a much simpler soution is to create your own custom ActionForm by
extending BeanValidatorForm (like LazyValidatorForm in 1.2.6)

public class PathBeanValidatorForm extends BeanValidatorForm {
    public LazyValidatorForm() {
        super(new LazyDynaBean());
        setPathValidation(true);
    }
}

... and then cofigure it in the usual way.

 <form-bean name="LazyBean"
 type="myPackage.PathBeanValidatorForm "/>

Niall

----- Original Message ----- 
From: "Joe Hertz" <[EMAIL PROTECTED]>
Sent: Monday, February 07, 2005 5:37 PM


> I'm using Struts 1.2.4.
>
> If in my struts-config I have something like this:
>
> <form-bean name="LazyBean"
> type="org.apache.commons.beanutils.LazyDynaBean"/>
>
> How can I get to the resulting form object to setPathValidation(true)?
>
> Is there a way I can tell Struts what particular BeanValidatorFom subclass
> to be using? Going to 1.2.6 is not an option right now.
>
> TIA
>
> -Joe



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

Reply via email to