It's Friday, it's late, and I'm answering my own posts....

replacing "newInstance()" with "getInstance()" does the trick.


At 10:02 PM 2/22/2002 -0700, you wrote:
>I was trying out Ted's code, slightly modified, in an Action class:
>
>protected ActionForm createActionForm(String path) {
>         ActionServlet as = this.getServlet();
>        ActionMapping mapping = as.findMapping(path);
>        String name = mapping.getName();
>        ActionForm form = null;
>        ActionFormBean formBean = as.findFormBean(name);
>                
>        if (formBean != null) {
>            String className = null;
>            className = formBean.getType();
>            try {
>                Class clazz = Class.forName(className);
>                form = (ActionForm) clazz.newInstance();
>            } catch (Throwable t) {
>                                t.printStackTrace();
>                form = null;
>            }
>        }
>                
>        return form;
>}
>
>And I noticed in my application that it made a brand new form bean with clean
>values (of course).  What I really wanted to do was get the existing bean from
>the controller.  I'm going to need to do this for several form beans so I like
>the idea of having a helper method and using the mappings.  
>
>Does anyone have some code/suggestions for doing this?
>
>Thanks,
>Sarah
>
>
>
>
>--
>To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>


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

Reply via email to