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

📄 refine.java

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

import com.laoer.bbscs.web.form.*;
import com.laoer.bbscs.bean.*;
import com.laoer.bbscs.web.servlet.*;
import com.laoer.bbscs.sys.*;
import org.apache.struts.util.*;
import org.apache.struts.action.*;
import javax.servlet.http.*;
import java.util.*;

/**
 * <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 Refine
    extends BaseAction {
  public ActionForward execute(ActionMapping actionMapping,
                               ActionForm actionForm,
                               HttpServletRequest httpServletRequest,
                               HttpServletResponse httpServletResponse) {
    ActionErrors errors = new ActionErrors();
    RefineForm form = (RefineForm) actionForm;

    UserCheck uc = this.getUserCheck(httpServletRequest, httpServletResponse,
                                     form.getBid());
    if (uc.getBs() == null) {
      errors.add("error.baordsno", new ActionError("error.baordsno"));
      saveErrors(httpServletRequest, errors);
      return actionMapping.findForward("error");
    }

    if (uc.isGuest()) {
      errors.add("error.pleaselogin", new ActionError("error.pleaselogin"));
      saveErrors(httpServletRequest, errors);
      //return actionMapping.findForward("login");
      return SysUtil.getPassLogin(actionMapping);
    }

    httpServletRequest.setAttribute("uc", uc);

    if (form.getAction().equals("refine") || form.getAction().equals("refinem")) {
      if (form.getAction().equals("refinem")) {
        if (!uc.isCanPostNotNeedExp()) {
          errors.add("error.purviewerror", new ActionError("error.purviewerror"));
          saveErrors(httpServletRequest, errors);
          return actionMapping.findForward("error");
        }
      }
      List flist = this.getForumService().findForumElite(form.getBid(),
          form.getBid(), form.getPid());
      List elist = this.getEliteService().findEliteByPidRid(form.getPid(),
          form.getBid());
      String dh = this.getEliteService().getEliteDH(form.getPid(), form.getBid(),
          "refine" + Constant.FILEPREFIX + "?action=" + form.getAction());
      httpServletRequest.setAttribute("flist", flist);
      httpServletRequest.setAttribute("elist", elist);
      httpServletRequest.setAttribute("dh", dh);
      httpServletRequest.setAttribute("bid", String.valueOf(form.getBid()));
      httpServletRequest.setAttribute("pid", String.valueOf(form.getPid()));
      if (form.getAction().equals("refine")) {
        return actionMapping.findForward("elite");
      }
      else {
        Vector v = new Vector();
        for (int i = 0; i < elist.size(); i++) {
          Elite elite = (Elite) elist.get(i);
          v.add(new LabelValueBean(elite.getElitename(),
                                   String.valueOf(elite.getId())));
        }
        httpServletRequest.setAttribute("dirvalues", v);
        EliteForm eliteForm = new EliteForm();
        eliteForm.setAction("");
        eliteForm.setBid(form.getBid());
        eliteForm.setPid(form.getPid());
        httpServletRequest.setAttribute("eliteForm", eliteForm);
        return actionMapping.findForward("elitem");
      }
    }

    return actionMapping.findForward("error");
  }
}

⌨️ 快捷键说明

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