日期:2014-05-18  浏览次数:20593 次

精通Structs中addressbook:删除功能的怎么实现?
前提xml中各组件已连上了,个常量也对应好了下面的代码可是不能删除啊???
1.
package   addressbook.forms;

import   javax.servlet.http.HttpServletRequest;
import   org.apache.struts.action.ActionMessage;
import   org.apache.struts.action.ActionErrors;
import   org.apache.struts.action.ActionForm;
import   org.apache.struts.action.ActionMapping;

public   final   class   DelForm   extends   ActionForm   {

        private   String   name   =   null;
        private   String   phone   =   null;
        private   String   address   =   null;
        private   String   hunk   =   null;
        private   String   delId   =   null;


        public   String   getName()   {
          return   name;
        }
      public   void   setName(String   name)   {
          this.name   =   name;
        }

      public   String   getPhone()   {
          return   phone;
        }
      public   void   setPhone(String   phone)   {
          this.phone   =   phone;
        }

      public   String   getAddress()   {
          return   address;
        }
      public   void   setAddress(String   address)   {
          this.address   =   address;
        }
      public   String   getHunk()   {
      return   address;
    }
  public   void   setHunk(String   hunk)   {
      this.hunk   =   hunk;
    }

     
public   String   getDelId()   {
return   delId;
}


public   void   reset(ActionMapping   mapping,   HttpServletRequest   request)   {

      //name   =   null;
      //phone   =   null;
      //address   =   null;
}
public   void   setDelId(String   delId)   {
this.delId   =   delId;
}

public   ActionErrors   validate(ActionMapping   mapping,
                                                        HttpServletRequest   request)   {

                ActionErrors   errors   =   new   ActionErrors();
                if   (((delId   ==   null)))
              &nb