Sometimes you have an Action that is going to forward to a JSP page with a 
form that should be pre-populated, but isn't the form that the Action is 
associated with.

For example, you might have a login form who's Action needs to pre-populate 
several different forms on a "change your address/credit card" page.  The 
login form needs to have access to these DynaForm objects to prepopulate 
them.  Here's a code example that will do just that:

ApplicationConfig appConfig =
         (ApplicationConfig)request.getAttribute(Action.APPLICATION_KEY);

FormBeanConfig formBeanConfig =
          appConfig.findFormBeanConfig("myDynaActionForm");

String beanType = formBeanConfig.getType();

DynaActionForm bean;

DynaActionFormClass formClass =
              DynaActionFormClass.createDynaActionFormClass(formBeanConfig);

bean = (DynaActionForm) formClass.newInstance();

request.setAttribute("myDynaActionForm", bean);


James



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

Reply via email to