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

📄 bullaction.java

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

import org.apache.struts.action.*;
import javax.servlet.http.*;
import com.laoer.bbscs.bbs.actionform.*;
import com.laoer.bbscs.bbs.business.*;
import com.laoer.bbscs.sysinfo.*;
import com.laoer.bbscs.util.*;
import com.laoer.bbscs.servlet.*;
import com.laoer.bbscs.db.*;
import org.apache.struts.util.*;
import java.util.*;

public class BullAction
    extends Action {

  public ActionForward execute(ActionMapping actionMapping,
                               ActionForm actionForm,
                               HttpServletRequest httpServletRequest,
                               HttpServletResponse httpServletResponse) {
    ActionErrors errors = new ActionErrors();
    BullActionForm form = (BullActionForm) actionForm;
    UserSessionCheck myUserSessionCheck = new UserSessionCheck(form.getSid(),
        httpServletRequest);
    if (!myUserSessionCheck.checkSession()) {
      errors.add("error.timeout", new ActionError("error.timeout"));
      saveErrors(httpServletRequest, errors);
      return actionMapping.findForward("error");
    }
    if (!myUserSessionCheck.isSuperAdmin()) {
      errors.add("purviewerror", new ActionError("error.purviewerror"));
      saveErrors(httpServletRequest, errors);
      return actionMapping.findForward("error");
    }
    httpServletRequest.setAttribute("myUserSessionCheck", myUserSessionCheck);
    httpServletRequest.setAttribute("sid", form.getSid());
    MessageResources messages = getResources(httpServletRequest);
    Locale locale = getLocale(httpServletRequest);
    if (form.getAction().equals("bulllist")) {
      Pages myPages = PagesFactory.getInstance();
      String[] pagessign = {
          messages.getMessage(locale, "bbscs.pages.first"),
          messages.getMessage(locale, "bbscs.pages.previous"),
          messages.getMessage(locale, "bbscs.pages.next"),
          messages.getMessage(locale, "bbscs.pages.end")};
      myPages.setPagesign(pagessign);
      myPages.setPerPageNum(Sys.SYSINFO.FORUMPERNUM);
      //myPages.setPerPageNum(2);
      myPages.setPages(Integer.parseInt(form.getPages()));
      myPages.setFileName(Sys.getURL() + "bullAction.do?sid=" + form.getSid() +
                          "&action=" + form.getAction() + "&isbull=" +
                          form.getIsbull() + "&");
      BulletinInfo bi = new BulletinInfo();
      Bulletin b = BulletinFactory.getInstance();
      bi.setIsBull(Integer.parseInt(form.getIsbull()));
      b.setBulletinInfo(bi);
      b.setPages(myPages);
      List blist = b.getBulletinList(null, "isBull");
      String pagebreakstr = b.getListPageBreak();
      httpServletRequest.setAttribute("pagebreakstr", pagebreakstr);
      httpServletRequest.setAttribute("blist", blist);
      httpServletRequest.setAttribute("isbull", form.getIsbull());
      errors = null;
      form = null;
      myUserSessionCheck = null;
      messages = null;
      locale = null;
      myPages = null;
      pagessign = null;
      bi = null;
      b = null;
      blist = null;
      pagebreakstr = null;
      return actionMapping.findForward("bulladmin");
    }
    if (form.getAction().equals("del")) {
      BulletinInfo bi = new BulletinInfo();
      Bulletin b = BulletinFactory.getInstance();
      bi.setID(Long.parseLong(form.getBuid()));
      bi.setIsBull(Integer.parseInt(form.getIsbull()));
      b.setBulletinInfo(bi);
      if (b.delBulletin(null, "ID") != Sys.RESULT_RIGHT) {
        errors.add("handlerror", new ActionError("error.handlerror"));
        saveErrors(httpServletRequest, errors);
        return actionMapping.findForward("error");
      }

      errors = null;
      //form = null;
      myUserSessionCheck = null;
      bi = null;
      b = null;
      /*
             httpServletRequest.setAttribute("aForwardInfo",
                                      new ForwardInfo("",
          Sys.getURL() + "bullAction.do?sid=" + form.getSid() +
          "&action=bulllist&isbull=" + form.getIsbull()));
             return actionMapping.findForward("forwards");*/

      ActionForward f = new ActionForward("/bullAction.do?sid=" +
                                          form.getSid() +
                                          "&action=bulllist&isbull=" +
                                          form.getIsbull(), true);
      return f;

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

⌨️ 快捷键说明

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