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

📄 noteactionform.java

📁 天乙代码src_531.rar 天乙代码src_531.rar 天乙代码src_531.rar 天乙代码src_531.rar
💻 JAVA
字号:
package com.laoer.bbscs.bbs.actionform;

import org.apache.struts.action.*;
import javax.servlet.http.*;
import com.laoer.bbscs.sysinfo.Sys;

public class NoteActionForm
    extends ActionForm {

  private String fname;
  private String action;
  private String mtype;
  private String note;
  private String noteID;
  private String[] noteIDs;
  private String pages;
  private String sid;

  public String getFname() {
    return fname;
  }

  public void setFname(String Fname) {
    this.fname = Fname;
  }

  public String getAction() {
    return action;
  }

  public void setAction(String action) {
    this.action = action;
  }

  public String getMtype() {
    return mtype;
  }

  public void setMtype(String mtype) {
    this.mtype = mtype;
  }

  public String getNote() {
    return note;
  }

  public void setNote(String note) {
    this.note = note;
  }

  public String getNoteID() {
    return noteID;
  }

  public void setNoteID(String noteID) {
    this.noteID = noteID;
  }

  public String[] getNoteIDs() {
    return noteIDs;
  }

  public void setNoteIDs(String[] noteIDs) {
    this.noteIDs = noteIDs;
  }

  public String getPages() {
    return pages;
  }

  public void setPages(String pages) {
    this.pages = pages;
  }

  public String getSid() {
    return sid;
  }

  public void setSid(String sid) {
    this.sid = sid;
  }

  public ActionErrors validate(ActionMapping actionMapping,
                               HttpServletRequest httpServletRequest) {
    ActionErrors errors = new ActionErrors();
    if (sid == null || sid.length() == 0 || action == null ||
        action.length() == 0) {
      errors.add("parametererror", new ActionError("error.parametererror"));
    }
    if (pages == null || pages.length() == 0) {
      pages = "1";
    }
    if (action.equals("show")) {
      if (fname == null || fname.length() == 0) {
        fname = "";
      }
    }
    if (action.equals("add")) {
      try {
        if (fname == null || fname.length() == 0 || note == null ||
            note.length() == 0 ||
            note.getBytes(Sys.SYSINFO.CHARSET).length > 2000) {
          errors.add("note.nullerror", new ActionError("note.nullerror"));
        }
      }
      catch (Exception e) {
      }
    }
    if (action.equals("del")) {
      if (noteID == null || noteID.length() == 0) {
        errors.add("parametererror", new ActionError("error.parametererror"));
      }
    }
    return (errors);
  }

  public void reset(ActionMapping actionMapping,
                    HttpServletRequest httpServletRequest) {
  }
}

⌨️ 快捷键说明

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