--- Begin Message ---
Hi All,

    I have a situation where there are two screens each having a form in it.  Both of them have identical fields. I have the data to be filled in the forms as a user object. I fill the values of the form inside my action class. Ths sample code is,

struts-config.xml:

<form-bean name = "severityForm" type = "com.adventnet.client.struts.action.MCDynaActionForm">
      <form-property name = "SeverityNode:SEVERITYID" type = "java.lang.String"/>
      <form-property name = "SeverityNode:SEVERITYVALUE" type = "java.lang.Integer"/>
      <form-property name = "SeverityNode:ICON" type = "java.lang.String"/>
      <form-property name = "SeverityNode:DESCRIPTION" type = "java.lang.String"/>
      <form-property name = "SeverityNode:COLOR" type = "java.lang.Integer"/>
</form-bean>

where MCDynaActionForm is an extension of DynaActionForm.

Action Class:

   public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) {
            String severity = request.getParameter("severity");
            if(severity == null){
                severity = "Clear";
            }
            DataObject severityNodeDO = ConfigurationCache.getDOFromTable("SeverityNode");
            Row severityRow  = new Row("SeverityNode");
            severityRow.set("SEVERITYID",severity);
            ArrayList tableList = new ArrayList();
            tableList.add("SeverityNode");
            DataObject newDO = severityNodeDO.getDataObject(tableList, severityRow);
            MCDynaActionForm userForm = (MCDynaActionForm) form;
            userForm.setDataObject(newDO);

           ActionForward forward = mapping.findForward("details");
           return forward;
    }

The setDataObject will internally parse the object and set the values to the map maintained by DynaActionForm.

In this case I am able to populate the values to the form successfully.

The problems comes when i try to remove one of the <form-property> values and try to access them in the jsp page. I get an exception like "No getter method for property email of bean ....."

I understand that specifying the fields in the struts-config.xml is the way to proceed. But as i fill the form with the dynamic values, can i leave out the declaration part in the xml file. i.e I would like the xml to be as

<form-bean name = "severityForm" type = "com.adventnet.client.struts.action.MCDynaActionForm"/>

without any <form-property> elements.

Is this possible or am i overlooking somthing. Kindly help.

Thanks
Shanmugam PL

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

Reply via email to