Hola,

I'm playing around with the DynaValidatorActionForm and attempting
(perhaps foolishly) to use them to perform CRUD functions using a
DispatchAction.

I have a DispatchAction that has doCreate, doUpdate, etc. methods
in it. I turn off validation in the action's struts-config definition
and call them manually in the appropriate methods (i.e., not doList).

In the olden days to do a CRUD action I would check to see if the
ActionForm passed in to the execute method was null. If it was, I'd
create one, populate it, go to the input page to display everything, and
run the action when the form was submitted (using an appropriate form
value to indicate what function I was performing) as per most of the
example webapps.

Now I want to do (more or less) the same thing using a
DynaValidatorActionForm so I can be less involved in form creation and
validation and only stick my head into it to do the actual backend code.

The problem is that I'm not sure how to go about creating a
DynaValidatorActionForm, initializing it, populating it, etc. The naive
solution, just making a new DynaValidatorActionForm bombs out with a
NullPointerException from the RequestProcessor but I haven't really
figured it out much beyond that.

Is it possible to do this, create a DynaValidatorActionForm if necessary
(for the first hit on the doUpdate method), initialize it from the
struts-config.xml file (so it knows what fields it needs), and throw it
into the request so the presentation page can do everything it would
normally do? If so, how?!

I searched the archive a bit and found little bits of info but nothing
that seemed to answer my question, and my foray into the Struts source
led me to believe that this type of thing is frowned upon at the
application level, but I'm tired and may have misunderstood.

Thanks much,
Dave Newton



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

Reply via email to