⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 txform.java

📁 STRUTS数据库项目开发宝典
💻 JAVA
字号:
package org.helpsoft.forms;

import java.util.Collection;
import java.util.ArrayList;
import javax.servlet.http.*;
import org.apache.struts.action.*;
import org.helpsoft.servicelocator.*;
import org.helpsoft.session.AssociatorManageService;
import com.helpsoft.Constants;
import org.helpsoft.session.*;

/**
 * Form bean for the tx form page.
 *
 * @author  cao guangxin - www.relationinfo.com
 * @struts.form name="txForm"
 */
public final class TxForm extends ServiceForm {
   private String mode;
   private String txbh;
   private String txmc;
   private String qtsz;
   private String sfky;

   /**
    * Returns the value of the <code>mode</code> property.
    *
    * @return the value of the <code>mode</code> property.
    */
   public String getMode() {
      return mode;
   }

   /**
    * Sets the value of the <code>mode</code> property.
    *
    * @param mode the mode
    */
   public void setMode(String mode) {
      this.mode = mode;
   }

   /**
    * Returns the value of the <code>txbh</code> property.
    *
    * @return the value of the <code>txbh</code> property.
    */
   public String getTxbh() {
      return txbh;
   }

   /**
    * Sets the value of the <code>txbh</code> property.
    *
    * @param txbh a value for <code>txbh</code>.
    */
   public void setTxbh(String txbh) {
      this.txbh = txbh;
   }

   /**
    * Returns the value of the <code>txmc</code> property.
    *
    * @return the value of the <code>txmc</code> property.
    */
   public String getTxmc() {
      return txmc;
   }

   /**
    * Sets the value of the <code>txmc</code> property.
    *
    * @param txmc a value for <code>txmc</code>.
    */
   public void setTxmc(String txmc) {
      this.txmc = txmc;
   }

   /**
    * Returns the value of the <code>qtsz</code> property.
    *
    * @return the value of the <code>qtsz</code> property.
    */
   public String getQtsz() {
      return qtsz;
   }

   /**
    * Sets the value of the <code>qtsz</code> property.
    *
    * @param qtsz a value for <code>qtsz</code>.
    */
   public void setQtsz(String qtsz) {
      this.qtsz = qtsz;
   }

   /**
    * Returns the value of the <code>sfky</code> property.
    *
    * @return the value of the <code>sfky</code> property.
    */
   public String getSfky() {
      return sfky;
   }

   /**
    * Sets the value of the <code>sfky</code> property.
    *
    * @param sfky a value for <code>sfky</code>.
    */
   public void setSfky(String sfky) {
      this.sfky = sfky;
   }


   /**
    * Obtains the total number of tx objects.
    *
    * @throws Exception exception
    * @return an integer value.
    */
   public int getListSize() throws Exception {
      return getAssociatorManageService().getTxListSize();
   }

   /**
    * Obtains a collection of all tx objects.
    *
    * @throws Exception exception
    * @return a collection of TxData objects.
    */
   public Collection getList() throws Exception {
      Collection result = getAssociatorManageService().getTxList();
      if (result.size() > 0) {
        return result;
      } else {
        return new ArrayList();
      }

   }

   /**
    * Performs server-side validation on the properties that have been set from this HTTP request,
    * and returns an <code>ActionErrors</code> object that encapsulates any
    * validation errors that have been found.  If no errors are found, returns
    * <code>null</code> or an <code>ActionErrors</code> object with no
    * recorded error messages.
    * <p>
    * <b>NOTE:</b> Please override this method and not the ValidatorForm 'validate'
    * method - any errors thrown in an overwritten 'validate' method will not be handled
    * by the GenericExceptionHandling framework.
    *
    * @param mapping The mapping used to select this instance
    * @param request The servlet request we are processing
    * @return a list with errors or <code>null</code> iIf no errors are found
    * @throws Exception - all exceptions are handled by the GenericExceptions framework
    * (no stack trace dumps shown to the user!)
    */
   public ActionErrors doValidate(ActionMapping mapping, HttpServletRequest request) throws Exception {
      boolean noValidate = (request.getParameter(Constants.SUBMIT_NO_VALIDATION) != null);
      return noValidate ? null : super.doValidate(mapping, request);
   }

   /**
    * Returns the string representation of the form.
    *
    * @return the string representation of the form
    */
   public String toString() {
      StringBuffer sb = new StringBuffer();
      sb.append("\ntxbh : ").append(txbh);
      sb.append("\ntxmc : ").append(txmc);
      sb.append("\nqtsz : ").append(qtsz);
      sb.append("\nsfky : ").append(sfky);
      return sb.toString();
   }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -