You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Michael McGrady <mi...@michaelmcgrady.com> on 2004/08/06 21:49:54 UTC

GOING GOING GONE DYNAMIC

Is there a way to create or modify the mapping and the form for an action 
on the fly?  Couldn't we use, for example, a "nude" DynaActionForm with a 
name and then (re)instantiate it with

form = DynamicActionFormFactory.createBlankForm(String name, String type, 
String[] fields);

or something similar and do something like this by grabbing the 
ActionMapping class and massaging it as needed as well?

Anyone have any things like this lying around in the sun?

Michael McGrady



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


Re: Lazy Dyna: Re: GOING GOING GONE DYNAMIC

Posted by Niall Pemberton <ni...@blueyonder.co.uk>.
You need the commons beanutils 1.7.0 for lazy DynaBeans - its not in the
1.6.1 jar - you can get it here:

   http://jakarta.apache.org/site/binindex.cgi

For the lazy ActionForm stuff you need the Struts nightly build, thats
available here:

  http://cvs.apache.org/builds/jakarta-struts/nightly/


Also download the LazyActionForms from my web site here:

  http://www.niallp.pwp.blueyonder.co.uk/lazyforms.zip


Use the jars from the Struts nightly build, except you need to replace the
commons beanutils with the 1.7.0 version - plus add the jar with the lazy
ActionForms.


Niall

----- Original Message ----- 
From: "Michael McGrady" <mi...@michaelmcgrady.com>
To: "Struts Users Mailing List" <us...@struts.apache.org>
Sent: Saturday, August 07, 2004 10:05 PM
Subject: Lazy Dyna: Re: GOING GOING GONE DYNAMIC


> At 05:54 AM 8/7/2004, you wrote:
> >If you really want to do a dynamic form created on the fly - then do it
the
> >easy way  (shameless plug), use lazy ActionForms :-)
> >
> >http://www.niallp.pwp.blueyonder.co.uk
> >
> >Niall
>
>
> When I download and build Struts 1.2.1 I get
> commons-beanutils-1.6.1.jar.  However, this does not contain Lazy dyna
> stuff.  When I download the commons-beanutils nightly, I do get the Lazy
> dyna stuff and also a commons-beanutils-core.java with an unnumbered
> commons-beanutils.jar.  How does this all get put together to run the
> LazyDyna stuff, Nia.
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
>



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


Lazy Dyna: Re: GOING GOING GONE DYNAMIC

Posted by Michael McGrady <mi...@michaelmcgrady.com>.
At 05:54 AM 8/7/2004, you wrote:
>If you really want to do a dynamic form created on the fly - then do it the
>easy way  (shameless plug), use lazy ActionForms :-)
>
>http://www.niallp.pwp.blueyonder.co.uk
>
>Niall


When I download and build Struts 1.2.1 I get 
commons-beanutils-1.6.1.jar.  However, this does not contain Lazy dyna 
stuff.  When I download the commons-beanutils nightly, I do get the Lazy 
dyna stuff and also a commons-beanutils-core.java with an unnumbered 
commons-beanutils.jar.  How does this all get put together to run the 
LazyDyna stuff, Nia.




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


Re: GOING GOING GONE DYNAMIC

Posted by Michael McGrady <mi...@michaelmcgrady.com>.
At 05:54 AM 8/7/2004, you wrote:
>especially all the chatter about
>passing form references


We're probably just lame, Niall, but the idea is to try something 
innovative on the fly.  What is being discussed is a way to dispense, 
essentially, with the action-mapping and form-beans XML.  Maybe this makes 
sense and maybe not.  But, what makes sense is clearly related to how and 
to when we can change the referent of a variable.  Sometimes seeking a new 
question is more important than seeking the answers to old questions.  I 
really like your contribution with the Lazy code.  Good work.

Is there anyway to change the commons utils to accommodate making a form a 
map?  That way you can instrument the forms.

Michael




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


Re: GOING GOING GONE DYNAMIC

Posted by Niall Pemberton <ni...@blueyonder.co.uk>.
I don't really get this thread at all, especially all the chatter about
passing form references.

Seems to me that you either override the RequestProcessor's
processActionForm() method and plug in your form factory there, since it
returns the ActionForm then there is no issue about references. Its just a
question of whether theres enough info in the ActionMapping for your form
factory to know what flavour form to create.

If you would rather create the ActionForm in the Action's execute method,
then again the issue about references is irrelevant since thats the last
place the ActionForm is referenced in the RequestProcessor's chain of
events. All you would need to do is create the form and store it in the
Request/Session under the mapping's attribute name (as it does in the
processActionForm() method). The downside of doing this is that you've
effectively skipped the ActionForm population mechanism.

If you really want to do a dynamic form created on the fly - then do it the
easy way  (shameless plug), use lazy ActionForms :-)

http://www.niallp.pwp.blueyonder.co.uk

Niall

----- Original Message ----- 
From: "Michael McGrady" <mi...@michaelmcgrady.com>
To: "Struts Users Mailing List" <us...@struts.apache.org>
Sent: Friday, August 06, 2004 8:49 PM
Subject: GOING GOING GONE DYNAMIC


> Is there a way to create or modify the mapping and the form for an action
> on the fly?  Couldn't we use, for example, a "nude" DynaActionForm with a
> name and then (re)instantiate it with
>
> form = DynamicActionFormFactory.createBlankForm(String name, String type,
> String[] fields);
>
> or something similar and do something like this by grabbing the
> ActionMapping class and massaging it as needed as well?
>
> Anyone have any things like this lying around in the sun?
>
> Michael McGrady



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