struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Will Hartung" <wi...@msoft.com>
Subject Dynamic DynaActionForms
Date Sat, 25 Mar 2006 01:53:56 GMT
Simply put I have a need for a configurable form that can have any mixture
of fields on it including, specifically, file uploads.

Seems to me that the DynaActionForm would be the way to go about this,
however, they're defined in struts-config.

Clearly, struts already has all of the code to convert an HTML request in to
a DynaActionForm, so I'd rather not reinvent that wheel if possible.

Now it seems to me that I should be able to simply instantiate my own
DynaActionForm that has all of the properties that coincedently looks like
the form that's being submitted.

Has anyone done something like this?

I've been playing with trying to instatiate an DynaActionForm using some
"hand made" FormPropertyConfig's, and then calling
DynaFormAction.initialize(FormConfigBean), but I'm getting some null pointer
exceptions, so I'm obviously missing something.

I'd also like to intercept the form creation process to make the
DynaActionForm on the fly during the request pipeline and, ideally, stuff
the form in the Request scope where it belongs. Right now I have to stuff it
in to the Session using an Action before the page is displayed, but
obviously this won't work if there is the potential for more than one form
to exist.

So, anyway, has anyone tried to leverage the Struts pipeline to create "on
the fly" DynaActionForms so you could leverage all of the built in Struts
facilities? Has anyone ever successfully created a DynaActionForm directly
rather than using the struts-config file?

Thanx!

Regards,

Will Hartung
(willh@msoft.com)




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


Mime
View raw message