oneguestbookform.java

来自「用于进行书写定单的源代码.请各位一定要好好研究」· Java 代码 · 共 60 行

JAVA
60
字号
package com.enlen.book;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionMapping;

import com.uniland.common.CallService;
import com.uniland.common.TaxServiceForm;
import com.uniland.dao.RowSet;

public class OneGuestBookForm extends TaxServiceForm {

	/**
	* Constructor
	*/
	public OneGuestBookForm() {
		 super();
	}

	 public void reset(ActionMapping mapping, HttpServletRequest request) {
         String strSQL = "";
         strSQL="select * from guestbook where id='"+request.getParameter("id")+"'";
         RowSet rsQuery = null;
         try{
           rsQuery = CallService.getDao().runSQLReturnRS(strSQL);
         }catch(Exception e){
           e.printStackTrace();
         }
        // request.getSession().setAttribute("guestbook",rsQuery );
         //RowSet rsQuery=(RowSet)request.getSession().getAttribute(Tokens.TEXT_QUERY );
         if (rsQuery==null) {

                 return;

         }

         if(rsQuery.rowCount()==0)
         {
                 rsQuery.addEmptyRow();
                  }

         mrs=rsQuery;

 }
 public ActionErrors validate(
         ActionMapping mapping,
         HttpServletRequest request) {

         ActionErrors errors = new ActionErrors();
         // Validate the fields in your form, adding
         // adding each error to this.errors as found, e.g.

         // if ((field == null) || (field.length() == 0)) {
         //   errors.add("field", new ActionError("error.field.required"));
         // }
         return errors;

 }
}

⌨️ 快捷键说明

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