This is a very good question. The JavaBeans in and out of the business layer and further down the data persistence layer are so called Data Transfer Objects. They sometimes overlap in terms of attributes a great deal with action forms that correspond to Web page forms. It's not good to use the action form beans as DTO objects, neither is it elegant to use DTO objects as action form beans. One way to structure the code is to define some base abstract classes with the common attributes and put these classes in a com.xxx.yyy.common package and these packages either belong to a separate utility jar or the business tier jar. Both the DTO classes and the action form bean classes will inherit from the abstract base class and add any more properties of their own.I would love to see more discussions on this.
protected AgentInfor agentinfor =new AgentInfor ();
public AgentInfor getAgentInfor(){
return agentInfor ;
}
public setAgentInfor(AgentInfor vo){
agentinfor =vo;
}
}在jsp页面上<html:text property="agentinfor.属性" />