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

📄 leftaction.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.servlet.*;
import com.laoer.bbscs.bbs.business.*;
import com.laoer.bbscs.sysinfo.*;
import com.laoer.bbscs.util.*;
import java.util.*;

public class LeftAction
    extends Action {

  public ActionForward execute(ActionMapping actionMapping,
                               ActionForm actionForm,
                               HttpServletRequest httpServletRequest,
                               HttpServletResponse httpServletResponse) {
    ActionErrors errors = new ActionErrors();
    SidActionForm form = (SidActionForm) 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");
    }
    httpServletRequest.setAttribute("myUserSessionCheck", myUserSessionCheck);
    httpServletRequest.setAttribute("sid", form.getSid());
    Boards myBoards = BoardsFactory.getInstance();
    if (myBoards == null) {
      errors.add("errornull", new ActionError("error"));
      saveErrors(httpServletRequest, errors);
      return actionMapping.findForward("error");
    }
    myBoards.setUserInfo(myUserSessionCheck.getUser().getUserInfo());
    List userSave = myBoards.getBoardsList(null, "UserBoardSave");
    httpServletRequest.setAttribute("UserBoardSave", userSave);
    Board myBoard = BoardFactory.getInstance();
    if (myBoard == null) {
      errors.add("errornull", new ActionError("error"));
      saveErrors(httpServletRequest, errors);
      return actionMapping.findForward("error");
    }
    List boardList = myBoard.getBoardList(null, "All");
    httpServletRequest.setAttribute("boardList", boardList);
    HashMap hm = new HashMap();
    int len = boardList.size();
    BoardsInfo aBoardsInfo = new BoardsInfo();
    BoardInfo aBoardInfo;
    List boardsList;
    for (int i = 0; i < len; i++) {
      aBoardInfo = (BoardInfo) boardList.get(i);
      aBoardsInfo.setBoardID(aBoardInfo.getID());
      myBoards.setBoardsInfo(aBoardsInfo);
      if (myUserSessionCheck.isSuperAdmin() || myUserSessionCheck.isManager() ||
          myUserSessionCheck.isBoardManager()) {
        boardsList = myBoards.getBoardsList(null, "BID");
      }
      else {
        boardsList = myBoards.getBoardsList(null, "BoardsList");
      }
      hm.put(String.valueOf(aBoardInfo.getID()), boardsList);
    }
    httpServletRequest.setAttribute("boardsList", hm);
    errors = null;
    form = null;
    myUserSessionCheck = null;
    myBoards = null;
    userSave = null;
    hm = null;
    aBoardsInfo = null;
    aBoardInfo = null;
    boardsList = null;
    return actionMapping.findForward("left");
  }
}

⌨️ 快捷键说明

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