struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave Newton <new...@pingsite.com>
Subject Re: No getter method servlet Exception. using DynaActionForm
Date Wed, 16 Nov 2005 16:06:56 GMT
fea jabi wrote:

> When I debug after
> DynaActionForm setupForm = (DynaActionForm) form;
>
> my setupForm is null

Is your struts config as you posted earlier? i.e., the "name" attribute 
refers to a Dyna form that doesn't exist in the "form-beans" section? 
That won't work.

> ModuleConfig moduleConfig =
>
>>>> RequestUtils.getModuleConfig(request,
>>>> getServlet().getServletContext());
>>>>         FormBeanConfig formConfig =
>>>> moduleConfig.findFormBeanConfig("CustForm");
>>>>         DynaActionFormClass dynaClass =
>>>> DynaActionFormClass.createDynaActionFormClass(formConfig);
>>>>
>>>>         try {
>>>>             setupForm = (DynaActionForm)dynaClass.newInstance();
>>>
>
> one of the user suggested that when I initialize a form-property in 
> struts-config using initial="true"
> I have to use the above to prepopulate the form.
>
> is this right?? Am I using at the right place.

If Struts is configured the form will have already been created on entry 
to the Action.

I think you need to back up a step and check your configuration. If you 
post the relevent sections again as they exist now we might be able to 
help you better.

Right now things are wrong, and I find it highly unlikely you would 
_ever_ need or want to instantiate a form inside an Action.

Dave



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


Mime
View raw message