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

📄 votepostform.java

📁 天乙社区6.0是一套基于JAVA技术的网络虚拟社区
💻 JAVA
字号:
package com.laoer.bbscs.web.form;

import org.apache.struts.action.*;
import com.laoer.comm.util.*;
import com.laoer.bbscs.sys.*;
import javax.servlet.http.*;

/**
 * <p>Title: TianYi BBS</p>
 * <p>Description: TianYi BBS System</p>
 * <p>Copyright: Copyright (c) 2004</p>
 * <p>Company: LAOER.COM/TIANYISOFT.NET</p>
 * @author laoer
 * @version 6.0
 */

public class VotePostForm
    extends ActionForm {

  private String action;
  private long bid;
  private int deadLineDay;
  private int deadLineMon;
  private int deadLineYear;
  private String detail;
  private short isM;
  private String title;

  public String getAction() {
    return action;
  }

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

  public long getBid() {
    return bid;
  }

  public void setBid(long bid) {
    this.bid = bid;
  }

  public int getDeadLineDay() {
    return deadLineDay;
  }

  public void setDeadLineDay(int deadLineDay) {
    this.deadLineDay = deadLineDay;
  }

  public int getDeadLineMon() {
    return deadLineMon;
  }

  public void setDeadLineMon(int deadLineMon) {
    this.deadLineMon = deadLineMon;
  }

  public int getDeadLineYear() {
    return deadLineYear;
  }

  public void setDeadLineYear(int deadLineYear) {
    this.deadLineYear = deadLineYear;
  }

  public String getDetail() {
    return detail;
  }

  public void setDetail(String detail) {
    this.detail = detail;
  }

  public short getIsM() {
    return isM;
  }

  public void setIsM(short isM) {
    this.isM = isM;
  }

  public String getTitle() {
    return title;
  }

  public void setTitle(String title) {
    this.title = title;
  }

  public ActionErrors validate(ActionMapping actionMapping,
                               HttpServletRequest httpServletRequest) {
    ActionErrors errors = new ActionErrors();
    if (action == null || action.length() == 0) {
      action = "new";
    }
    if (action.equals("addvote")) {
      if (title != null) {
        title = title.trim();
      }
      if (Util.nullOrBlank(title) ||
          SysUtil.getStrLength(title, Constant.CHARSET) > 90) {
        errors.add("titletoolong", new ActionError("error.post.titletoolong"));
      }
      title = Util.escapeHTMLTags(title);
      Result r = SysUtil.getBadWordsInPost(title);
      if (!r.isRight()) {
        errors.add("error.post.badwors1",
                   new ActionError("error.post.badwors1", (String) r.getObject()));
      }
      if (detail != null) {
        detail = detail.trim();
      }
      if (Util.nullOrBlank(detail)) {
        errors.add("error.post.nodetail", new ActionError("error.post.nodetail"));
      }
      if (SysUtil.getStrLength(detail, Constant.CHARSET) >
          (SysInfo.getInstance().getPostmaxsize() * 1024)) {
        errors.add("texttoolong",
                   new ActionError("error.post.texttoolong",
                                   String.valueOf(SysInfo.getInstance().
                                                  getPostmaxsize())));
      }
      if (Util.Date2Long(deadLineYear, deadLineMon, deadLineDay) <=
          Util.getLongTime()) {
        errors.add("error.vote.deadline", new ActionError("error.vote.deadline"));
      }
    }
    return errors;
  }

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

⌨️ 快捷键说明

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