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

📄 aminpmset.java

📁 java论坛
💻 JAVA
字号:
package com.laoer.bbscs.web.action;

import javax.servlet.http.*;

import org.apache.struts.action.*;
import com.laoer.bbscs.service.config.*;
import com.laoer.bbscs.web.form.*;
import com.laoer.bbscs.exception.SysConfigException;

public class AminPmSet
    extends Action {

  private SysConfig sysConfig;

  public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request,
                               HttpServletResponse response) {
    AminPmSetForm aminPmSetForm = (AminPmSetForm) form;

    if (aminPmSetForm.getAction().equalsIgnoreCase("index")) {
      aminPmSetForm.setAction("save");
      aminPmSetForm.setCheckNewPm(this.getSysConfig().getCheckNewPm());
      aminPmSetForm.setPmAllowFace(this.getSysConfig().getPmAllowFace());
      aminPmSetForm.setPmAllowHTML(this.getSysConfig().getPmAllowHTML());
      aminPmSetForm.setPmAllowSmilies(this.getSysConfig().getPmAllowSmilies());
      aminPmSetForm.setPmAllowUBB(this.getSysConfig().getPmAllowUBB());
      aminPmSetForm.setPmFloodTime(this.getSysConfig().getPmFloodTime());
      aminPmSetForm.setPmMaxLength(this.getSysConfig().getPmMaxLength());
      aminPmSetForm.setPmPerPage(this.getSysConfig().getPmPerPage());
      aminPmSetForm.setUsePm(this.getSysConfig().getUsePm());
      return mapping.findForward("pmSet");
    }

    if (aminPmSetForm.getAction().equalsIgnoreCase("save")) {
      ActionMessages messages = new ActionMessages();
      this.getSysConfig().setCheckNewPm(aminPmSetForm.getCheckNewPm());
      this.getSysConfig().setPmAllowFace(aminPmSetForm.getPmAllowFace());
      this.getSysConfig().setPmAllowHTML(aminPmSetForm.getPmAllowHTML());
      this.getSysConfig().setPmAllowSmilies(aminPmSetForm.getPmAllowSmilies());
      this.getSysConfig().setPmAllowUBB(aminPmSetForm.getPmAllowUBB());
      this.getSysConfig().setPmFloodTime(aminPmSetForm.getPmFloodTime());
      this.getSysConfig().setPmMaxLength(aminPmSetForm.getPmMaxLength());
      this.getSysConfig().setPmPerPage(aminPmSetForm.getPmPerPage());
      this.getSysConfig().setUsePm(aminPmSetForm.getUsePm());
      try {
        this.getSysConfig().saveConfigs();
        messages.add("resultMsg", new ActionMessage("bbscs.dataupdate.succeed"));
        this.saveMessages(request, messages);
      }
      catch (SysConfigException ex) {
        messages.add("error.dataupdate.failed", new ActionMessage("error.dataupdate.failed"));
        this.saveErrors(request, messages);
      }
      return mapping.findForward("pmSet");
    }

    return mapping.getInputForward();
  }

  public SysConfig getSysConfig() {
    return sysConfig;
  }

  public void setSysConfig(SysConfig sysConfig) {
    this.sysConfig = sysConfig;
  }
}

⌨️ 快捷键说明

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