Do you need to have one-to-one mapping between fields on the
jsp page which contains the form, and the
fields in the ActionForm subclass ? Or is it just one-to-one mapping between the fields on the jsp page and the
getter and setter methods in the ActionForm subclass?
Example : Can I do this?
public class AddPayeeForm extends ActionForm
{
private Payee p;
public void setName (
String name)
{
p.setName (name);
}
String getName ()
{
return p.getName ();
}
public void setAddressLine1 (String addressLine1)
{
p.setAddressLine1 (addressLine1);
}
public String getAddressLine1 ()
{
return p.getAddressLine1 ();
}
and so on ..
I have to create a Payee object since I have to show all the payees in ShowPayees.jsp and I will be repeating the same methods in my Payee class and AddPayeeForm class (ActionForm subclass) , so this will avoid duplication of code to a certain extent.
Or is there any other better way to do this?
Any help will be greatly appreciated!