DynaValidatorForm dynaForm = (DynaValidatorForm)form;
String name = (String)dynaForm.get("name");

-----Original Message-----
From: Scott Purcell [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, February 22, 2005 3:38 PM
To: user@struts.apache.org
Subject: DynaActionForms Question


Hello,
 
I have a question about using DynaActionForm objects. I would like to use
DynaActionForm class to keep maintenance simpler. But I do not know how to
get the form values out in the action class? 
 
 
I have the following bean set up.
 
  <form-beans>
    <form-bean
       name="loginbean"
       type="org.apache.struts.action.DynaActionForm">
        <form-property name="name" type="java.lang.String" initial="Titan"
/>
     </form-bean>
  </form-beans>
 
Now in the action class when I am working in the execute() method
how do I get the data back from the bean?
 
I tried the following
 public ActionForward executeAction(ActionMapping mapping,
                               ActionForm form,
                               HttpServletRequest request,
                               HttpServletResponse response,
                               UserContainer userContainer)
    throws Exception {
 

    //    MenuObject menu = new MenuObject();
    System.out.println((String)form.getName());

 
and of course it will not compile, because it doesn't recognize any methods
in the form. Can you not get data back from a dynaform like you can a normal
bean?
 

Thanks
Scott


------------------------------------------------------------------------------
Notice:  This e-mail message, together with any attachments, contains 
information of Merck & Co., Inc. (One Merck Drive, Whitehouse Station, New 
Jersey, USA 08889), and/or its affiliates (which may be known outside the 
United States as Merck Frosst, Merck Sharp & Dohme or MSD and in Japan, as 
Banyu) that may be confidential, proprietary copyrighted and/or legally 
privileged. It is intended solely for the use of the individual or entity named 
on this message.  If you are not the intended recipient, and have received this 
message in error, please notify us immediately by reply e-mail and then delete 
it from your system.
------------------------------------------------------------------------------

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

Reply via email to