Hey Michael,

ActionMapping is a subclass of ActionConfig, right? So if you use a similar
construct for your mapping as for your form config, it *might* work (caveat:
superficial API scan only; no testing). It's just a question of where in
your food chain you do it (inside your Action class execute() method,
perhaps).

Of course, that would defeat the declarativity (is that a word?) of an
ActionMapping...

I imagine Mr. McClanahan will weigh in on this at some point ;-)

My 1.25 (inflation-beridden) cents,

Curtis

"Michael McGrady" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> At 12:57 PM 8/6/2004, you wrote:
> >The problem would with Java in this case, since form is passed in.....
> >
> >you could do something like
> >         BeanUtils.copyProperties( form,
> > DynamicActionFormFactory.createBlankForm( blah blah);
> >and that might work better.
>
>
> public class DynamicActionFormFactory {
>    public static ActionForm createBlankForm(String name, String type,
> String[] fields) {
>      ActionForm form = null;
>      FormBeanConfig config = null;
>      FormPropertyConfig prop = null;
>      config = new FormBeanConfig();
>      config.setName(name);
>      config.setType(type);
>      if (fields != null) {
>        for (int i=0; i<fields.length; i++) {
>          prop = new FormPropertyConfig();
>          prop.setName(fields[i]);
>          prop.setType("java.lang.String");
>          prop.setInitial("");
>          prop.freeze();
>          config.addFormPropertyConfig(prop);
>        }
>      }
>      config.freeze();
>      try {
>        form = (ActionForm)
> DynaActionFormClass.createDynaActionFormClass(config).newInstance();
>      } catch (Exception e) {
>        StdOut.log("log.error",new ChainedException(e,"Exception creating
> blank form: " + e.getMessage()));
>      }
>      return form;
>    }
> }
>
> What about the ActionMapping?
>
> Michael McGrady
>
>




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

Reply via email to