I think you have to set <form-property...> in
struts-config.xml to let struts know what attributes
the form has.
Otherwise the tags like <html:text .../> and
<bean:write ...> tags will try to call the getter
methods of the form bean.

Regards,
Vincent

 --- shanmugampl <[EMAIL PROTECTED]> :> 
> 


---------------------------------
    Hi All,

    I have a situation where there are two screens
each having a formin it.  Both of them have identical
fields. I have the data to befilled in the forms as a
user object. I fill the values of the forminside 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,
ActionFormform, 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 valuesto 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. Iget an exception like "No getter method
for property email of bean....."

I understand that specifying the fields in the
struts-config.xml is theway to proceed. But as i fill
the form with the dynamic values, can ileave out the
declaration part in the xml file. i.e I would like
thexml 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
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
[EMAIL PROTECTED] 



-----------------------------------------------------------------
每天都 Yahoo!奇摩
海的顏色、風的氣息、愛你的溫度,盡在信紙底圖
http://tw.promo.yahoo.com/mail_premium/stationery.html

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

Reply via email to