电子通讯薄(MVC) :此示例基于MVC模式,包含四个界面:登入、添加数据、查询数据和显示所有数据,通过这个示例将会对Struts构架有进一步的了解

源代码在线查看: insertform.java

软件大小: 1498 K
上传用户: xof1234
关键词: MVC Struts 数据 电子通讯
下载地址: 免注册下载 普通下载 VIP

相关代码

				package addressbook.forms;								import org.apache.struts.action.*;				import javax.servlet.http.*;				import addressbook.model.*;								public class InsertForm extends ActionForm {								  private AddressBook addressBook=new AddressBook();				  public void AddressBook(AddressBook addressBook)				  {				    this.addressBook=addressBook;				  }								  public AddressBook getAddressBook()				  {				    return this.addressBook;				  }								  public void setName(String name)				  {				    this.addressBook.setName(name);				  }								  public String getName()				  {				    return this.addressBook.getName();				  }								  public void setPhone(String phone)				  {				    this.addressBook.setPhone(phone);				  }								  public String getPhone()				  {				    return this.addressBook.getPhone();				  }								  public void setAddress(String address)				  {				    this.addressBook.setAddress(address);				  }								  public String getAddress()				  {				    return this.addressBook.getAddress();				  }				  public ActionErrors validate(ActionMapping actionMapping, HttpServletRequest httpServletRequest) {				    /**@todo: finish this method, this is just the skeleton.*/				    return null;				  }				  public void reset(ActionMapping actionMapping, HttpServletRequest httpServletRequest) {				    this.addressBook=new AddressBook();				  }				}							

相关资源