/** * 根据URL参数执行 toCustinfoList 方法,返回要forward页面。 * * @param ActionMapping * @param ActionForm * @param HttpServletRequest * @param HttpServletResponse * @return ActionForward 返回列表页面 */ public ActionForward toPhoneList( ActionMapping map, ActionForm form, HttpServletRequest request, HttpServletResponse response) { DynaActionFormDTO dto = (DynaActionFormDTO) form; String pageState = null; PageInfo pageInfo = null; pageState = (String) request.getParameter("pagestate"); // System.out.println("pageState=" + pageState); if (pageState == null) { pageInfo = new PageInfo(); } else { PageTurning pageTurning = (PageTurning) request.getSession().getAttribute("userpageTurning"); pageInfo = pageTurning.getPage(); pageInfo.setState(pageState); dto = (DynaActionFormDTO) pageInfo.getQl(); } pageInfo.setPageSize(20); // 取得list及条数 List list = custinfoService.phoneQuery(dto, pageInfo); int size = custinfoService.getPhoneSize(); System.out.println("size=" + size); pageInfo.setRowCount(size); pageInfo.setQl(dto); request.setAttribute("list", list); PageTurning pt = new PageTurning(pageInfo, "", map, request); request.getSession().setAttribute("userpageTurning", pt); return map.findForward("phonelist"); }
/** @describe 帖子列表 */ public ActionForward toPostList( ActionMapping map, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { DynaActionFormDTO dto = (DynaActionFormDTO) form; String moduleId = ""; if (request.getParameter("itemid") == null) { moduleId = (String) request.getSession().getAttribute("topicId"); } else { moduleId = request.getParameter("itemid"); } request.setAttribute("itemid", moduleId); // 以下为区域列表 // List modulelist = new ArrayList(); // try { // modulelist = forumListService.moduleQuery(moduleId); // } catch (RuntimeException e) { // // TODO Auto-generated catch block // e.printStackTrace(); // } // request.setAttribute("modulelist", modulelist); // 以下为帖子列表 String pageState = null; PageInfo pageInfo = null; pageState = (String) request.getParameter("pagestate"); request.getSession().setAttribute("topicId", moduleId); if (pageState == null) { pageInfo = new PageInfo(); } else { PageTurning pageTurning = (PageTurning) request.getSession().getAttribute("postpageTurning"); pageInfo = pageTurning.getPage(); pageInfo.setState(pageState); dto = (DynaActionFormDTO) pageInfo.getQl(); } pageInfo.setPageSize(5); List postlist = new ArrayList(); try { postlist = forumListService.postListQuery(moduleId, pageInfo); } catch (RuntimeException e) { // TODO Auto-generated catch block e.printStackTrace(); } int size = forumListService.getSizeNum(); pageInfo.setRowCount(size); pageInfo.setQl(dto); request.setAttribute("postlist", postlist); PageTurning pt = new PageTurning(pageInfo, "/ETforum/", map, request); request.getSession().setAttribute("postpageTurning", pt); return map.findForward("postlist"); }
/** * @describe 跳转到回帖页 * @param map 类型 ActionMapping * @param form 类型 ActionForm * @param request 类型 HttpServletRequest * @param response 类型 HttpServletResponse * @return 类型 ActionForward */ public ActionForward toAnswerPostList( ActionMapping map, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { DynaActionFormDTO dto = (DynaActionFormDTO) form; String moduleId = ""; if (request.getParameter("itemid") == null) { moduleId = (String) request.getSession().getAttribute("topicId"); } else { moduleId = request.getParameter("itemid"); } request.setAttribute("itemid", moduleId); String postid = ""; if (request.getParameter("postid") == null) { postid = (String) request.getSession().getAttribute("postsId"); } else { postid = request.getParameter("postid"); } request.setAttribute("postid", postid); String pageState = null; PageInfo pageInfo = null; pageState = (String) request.getParameter("pagestate"); request.getSession().setAttribute("topicId", moduleId); request.getSession().setAttribute("postsId", postid); if (pageState == null) { pageInfo = new PageInfo(); } else { PageTurning pageTurning = (PageTurning) request.getSession().getAttribute("answerpageTurning"); pageInfo = pageTurning.getPage(); pageInfo.setState(pageState); dto = (DynaActionFormDTO) pageInfo.getQl(); } pageInfo.setPageSize(5); List postlist = forumListService.answerList(moduleId, postid, pageInfo); int size = forumListService.getAnswerNum(); pageInfo.setRowCount(size); pageInfo.setQl(dto); request.setAttribute("answerlist", postlist); request.setAttribute("posttitle", forumListService.getPostsTitle(postid)); PageTurning pt = new PageTurning(pageInfo, "/ETforum/", map, request); request.getSession().setAttribute("answerpageTurning", pt); return map.findForward("answerlist"); }
/** * 根据URL参数执行 toCustinfoList 方法,返回要forward页面。 * * @param ActionMapping * @param ActionForm * @param HttpServletRequest * @param HttpServletResponse * @return ActionForward 返回列表页面 */ public ActionForward toCustinfoList( ActionMapping map, ActionForm form, HttpServletRequest request, HttpServletResponse response) { Object o = request.getSession().getAttribute("telnum"); DynaActionFormDTO dto = (DynaActionFormDTO) form; String tel = ""; if (o != null) { tel = o.toString(); dto.set("cust_tel_home", tel); request.getSession().removeAttribute("telnum"); } String pageState = null; PageInfo pageInfo = null; pageState = (String) request.getParameter("pagestate"); if (pageState == null) { pageInfo = new PageInfo(); } else { PageTurning pageTurning = (PageTurning) request.getSession().getAttribute("userpageTurning"); pageInfo = pageTurning.getPage(); pageInfo.setState(pageState); dto = (DynaActionFormDTO) pageInfo.getQl(); } pageInfo.setPageSize(14); // 取得list及条数 List list = custinfoService.custinfoQuery(dto, pageInfo); int size = custinfoService.getCustinfoSize(); pageInfo.setRowCount(size); pageInfo.setQl(dto); request.setAttribute("list", list); PageTurning pt = new PageTurning(pageInfo, "", map, request); request.getSession().setAttribute("userpageTurning", pt); return map.findForward("list"); }
/** * Method execute * * @param mapping * @param form * @param request * @param response * @return ActionForward */ public ActionForward toTelQuery( ActionMapping map, ActionForm form, HttpServletRequest request, HttpServletResponse response) { DynaActionFormDTO formdto = (DynaActionFormDTO) form; String pageState = null; PageInfo pageInfo = null; pageState = (String) request.getParameter("pagestate"); if (pageState == null) { pageInfo = new PageInfo(); } else { PageTurning pageTurning = (PageTurning) request.getSession().getAttribute("telQueryPageTurning"); pageInfo = pageTurning.getPage(); pageInfo.setState(pageState); formdto = (DynaActionFormDTO) pageInfo.getQl(); } pageInfo.setPageSize(14); List list = new ArrayList(); try { list = telQueryService.telQuery(formdto, pageInfo); // list = telQueryService.getTel(formdto, pageInfo,pageState); } catch (RuntimeException e) { e.printStackTrace(); } int size = telQueryService.getSize(); // System.out.println(size); pageInfo.setRowCount(size); pageInfo.setQl(formdto); request.setAttribute("list", list); PageTurning pt = new PageTurning(pageInfo, "/cc_police_heb/", map, request); request.getSession().setAttribute("telQueryPageTurning", pt); return map.findForward("list"); }