You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by sr...@chennai.tcs.co.in on 2003/08/04 10:52:18 UTC

Regarding STRUTS ActionForm

Can the ActionForm contain some other Message Objects as attributes ? If so
where should the getters and setters for the child MO be coded ? For
example in the below structure MyActionForm is the ActionForm that contains
the user defined MO's MyDepartment and MyProject. First of all is
MyActionForm a valid ActionForm as per STRUTS ? If so where should the
getter and setter for departmentNumber, departmentName, projectNumber,
projectName reside ? Should it be within the MyActionForm or MyDepartment
and MyProject respectively ?

e.g :       MyActionForm inherits ActionForm
      {
            int employeeNumber;
            string employeeName;
            MyDepartment department;
            MyProject project;
      }

      MyDepartment
      {
            int departmentNumber;
            string departmentName;
      |

      MyProject
      {
            int projectNumber;
            string projectName;
      }

Thanks
Sreekant G.
TCS AMBATTUR



Re: Regarding STRUTS ActionForm

Posted by Nagendra Kumar O V S <na...@ikigo.com>.
hello,
1)The actionform(MyActionForm) is absolutely, though few tips
        a. try using String variables AFAP, for elements u want to map html
form elements and the action form
        b. all such elements should have the corresponding set/get methods
for struts to properly populate the form elements in to             ur
action form
2)All the members in MyActionForm should have the corresponding set/get in
the action form itself. and
3)MyDepartment,MyProject should have the set/get methods defined for the
members within their own classes..

-- nagi

-------Original Message-------

From: Struts Users Mailing List
Date: Monday, August 04, 2003 02:22:50 PM
To: struts-user@jakarta.apache.org
Subject: Regarding STRUTS ActionForm

Can the ActionForm contain some other Message Objects as attributes ? If so
where should the getters and setters for the child MO be coded ? For
example in the below structure MyActionForm is the ActionForm that contains
the user defined MO's MyDepartment and MyProject. First of all is
MyActionForm a valid ActionForm as per STRUTS ? If so where should the
getter and setter for departmentNumber, departmentName, projectNumber,
projectName reside ? Should it be within the MyActionForm or MyDepartment
and MyProject respectively ?

e.g : MyActionForm inherits ActionForm
{
int employeeNumber;
string employeeName;
MyDepartment department;
MyProject project;
}

MyDepartment
{
int departmentNumber;
string departmentName;
|

MyProject
{
int projectNumber;
string projectName;
}

Thanks
Sreekant G.
TCS AMBATTUR