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

📄 myforum.java

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

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

/**
 * <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 MyForum
    extends BaseAction {
  public ActionForward execute(ActionMapping actionMapping,
                               ActionForm actionForm,
                               HttpServletRequest httpServletRequest,
                               HttpServletResponse httpServletResponse) {
    ActionErrors errors = new ActionErrors();
    ForumForm form = (ForumForm) 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.getBs().getAttrib5() == 0) {
      errors.add("error.forum.canontread",
                 new ActionError("error.forum.canontread"));
      saveErrors(httpServletRequest, errors);
      return actionMapping.findForward("error");
    }
    /*
         UserInfo ui = this.getUserCache().getUserInfoFromCache(uc.getId());
         if (ui == null) {
      errors.add("error.getusererror", new ActionError("error.getusererror"));
      saveErrors(httpServletRequest, errors);
      return actionMapping.findForward("error");
         }*/

    Pages pages = new Pages(httpServletRequest);
    pages.setPage(form.getPage());
    //pages.setPerPageNum(2);
    pages.setPerPageNum(uc.getFormPerNum());
    pages.setFileName("forum" + Constant.FILEPREFIX + "?bid=" + form.getBid());
    pages.setStyle(3);
    if (form.getT() > 0) {
      pages.setTotals(form.getT());
    }
    PageList pl = getForumService().getForumMainList(form.getBid(), pages);
    httpServletRequest.setAttribute("pl", pl);
    httpServletRequest.setAttribute("uc", uc);
    //httpServletRequest.setAttribute("ui", ui);
    httpServletRequest.setAttribute("pages", String.valueOf(form.getPage()));
    //httpServletRequest.setAttribute("forumForm", form);
    SearchPostForm searchPostForm = new SearchPostForm();
    searchPostForm.setBid(form.getBid());
    httpServletRequest.setAttribute("searchPostForm", searchPostForm);
    return actionMapping.findForward("forum");
  }
}

⌨️ 快捷键说明

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