struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "WILLIAMS,RAND (HP-USA,ex1)" <rand.willi...@hp.com>
Subject RE: [Q] extends DynaValidatorActionForm
Date Fri, 07 Mar 2003 15:33:13 GMT
True for if the bean config was in the struts-config,
but what if I want to extend DynaValidatorForm?

I wonder what format constructor it needs to have.?

-Rand


-----Original Message-----
From: Jose Gonzalez Gomez [mailto:jgonzalez@opentechnet.com]
Sent: Friday, March 07, 2003 4:05 AM
To: Struts Users Mailing List
Subject: Re: [Q] extends DynaValidatorActionForm



    Try this:

    ModuleConfig moduleConfig = (ModuleConfig) 
httpServletRequest.getAttribute( Globals.MODULE_KEY );
    FormBeanConfig supplierConfig = moduleConfig.findFormBeanConfig( 
"whateverYourBeanNameInStrutsConfig" );
    DynaValidatorActionForm actionForm = (DynaValidatorActionForm) 
DynaActionFormClass.createDynaActionFormClass( supplierConfig )
 

.newInstance(  );

    Regards
    Jose


WILLIAMS,RAND (HP-USA,ex1) wrote:

>(Craig?)
>
>I try to extend DynaValidatorActionForm,
>using a no-argument constructor (as it has),
>but when instantiating using the DynaBeanClass.newInstance( x, y, z ),
>I am required to use a constructor( DynaClass ),
>which DynaValidatorActionForm does not have...
>
>Has anyone a working example of extending DynaValidatorForm, or
>DynaActionForm?
>Please let me know.... 
>
>Thank you in advance!!
>
>(PS Thank you for your answers so far!!)
>
>Rand Williams
>Hewlett-Packard
>
>
>And It would be a bonus to show me how I can instantiate the new class
>using something like this:
>
>
>   824      BasicDynaClass dynaClass =
>   825        new BasicDynaClass(
>   826           "DynaSmModelValidatorFormClass",
>   827            DynaSmModelValidatorForm.class,
>   828            props);
>   829
>   830      try {
>   831        DynaSmModelValidatorForm elementBean =
>(DynaSmModelValidatorForm) dynaClass.newInstance();
>
>
>java.lang.IllegalArgumentException: 
>Class com.hp.sm.model.DynaSmModelValidatorForm does not have an appropriate
>constructor
>	at
>org.apache.commons.beanutils.BasicDynaClass.setDynaBeanClass(BasicDynaClass
.
>java:310)
>	at
>org.apache.commons.beanutils.BasicDynaClass.(BasicDynaClass.java:128)
>
>
>public class DynaSmModelValidatorForm extends DynaValidatorActionForm
>{
>  public DynaSmModelValidatorForm() {
>        super();
>  }
>}
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
>
>  
>



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

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


Mime
View raw message