亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? topicaction.java

?? struts+hibernate BBS mysql數據庫 功能基本齊全
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
		forumtopicreply.setLocked(Byte.valueOf(locked));
		if (!El.getEl().getForumUserMgr().ReplyTopic(forumtopicreply)) {
			ActionErrors errors = new ActionErrors();
			errors.add("", new ActionError("forum.reply.errors"));
			saveErrors(request, errors);
			//System.out.println("錯誤啦");
			return (new ActionForward(mapping.getInput()));
		}
		// 獲取 forumTopic reply + 1
		ForumTopic fourmTopic = El.getEl().getTopicMgr().getTopicId(topicId);
		fourmTopic.setReply(fourmTopic.getReply() + 1);
		El.getEl().getTopicMgr().saveTopic(fourmTopic);
		//System.out.println("reply:::::::::::::::::+1");
		// 讀出TOPIC FROM PIECE
		List<Forumtopicreply> falist = El.getEl().getTopicMgr().findTopicReply(
				topicId);
		request.setAttribute("reply", falist);
		request.setAttribute("pieceId", pieceId);
		request.setAttribute("topicId", topicId);
		request.setAttribute("pieceTopic", El.getEl().getTopicMgr()
				.findPieceTopic(topicId));

		// 構造位置,由showTopic..TopicAction.負責
		return this.showTopic(mapping, form, request, response);
		//return mapping.findForward("showTopic");
	}

	/*
	 * 1,如果返回fa是NULL,則沒有文章. 2,構造位置. 3,獲取回復. 4,獲取引用片段. (non-Javadoc)
	 * 
	 * @see com.elan.forum.actions.topic.TopicBaseAction#quoteReply(org.apache.struts.action.ActionMapping,
	 *      org.apache.struts.action.ActionForm,
	 *      javax.servlet.http.HttpServletRequest,
	 *      javax.servlet.http.HttpServletResponse)
	 */
	@Override
	protected ActionForward quoteReply(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) {
		Integer topicId = getTopicId(request);
		ForumTopic fa = El.getEl().getTopicMgr().findPieceTopic(topicId);
		if (fa == null) {
			ActionErrors errors = new ActionErrors();
			// 1 無此帖子
			errors.add("", new ActionError("topic.no.find"));
			saveErrors(request, errors);
			return mapping.findForward("topicNotFind");
		}
		// 2 //構造路徑
		/*String position = constructPosition(request, fa.getPiece().getId(), fa
				.getPiece().getName(), fa.getId(), fa.getTitle());
		request.setAttribute("position", position);

		// 3 獲取回復的帖子
		List<Forumtopicreply> falist = El.getEl().getTopicMgr().findTopicReply(
				topicId);
		ForumUser topicAuthor = fa.getForumUser();
		request.setAttribute("topicAuthor", topicAuthor);
		request.setAttribute("replyList", falist);
		request.setAttribute("topic", fa);
		request.setAttribute("pieceId", fa.getPiece().getId());*/
		//TEST://System.out.println("pieceId:" + fa.getPiece().getId());
		// 4
		String quoteStr = request.getParameter("quoteId");
		Integer quoteId;
		if (quoteStr != null) {
			quoteId = (Integer.valueOf(quoteStr));
			if (topicId.intValue() != quoteId.intValue()) {
				Forumtopicreply ftr = El.getEl().getTopicMgr()
						.findTopicReplyById(quoteId);
				if (ftr != null) {
					request.setAttribute("quoteReply", "以下是引用 ["
							+ ftr.getAuthor() + "] 片段:<br>" + ftr.getText());
				}
			}
		} else {
			request.setAttribute("quoteReply", "以下是引用 [" + fa.getAuthor()
					+ "] 片段:<br>" + fa.getText());
		}
		//System.out.println("沒有任何的問題哦!");
		//return mapping.findForward("showTopic");
		//return new ActionForward("topic.do?action=showTopic&topicId=" + topicId);
		return this.showTopic(mapping, form, request, response);
	}

	/**
	 * 返回熱門帖子
	 * 
	 * @return ActionForward
	 */
	@Override
	protected ActionForward hotTopic(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) {
		Integer pieceId = this.getPieceId(request);
		String pieceName = null;
		Integer topicCount = Constents.hotTopicCount;
		if (pieceId != null) {
			pieceName = El.getEl().getTopicMgr().getForumPieceById(pieceId)
					.getName();
			this.setAttribute(request, "pieceId", pieceId);
		}
		String position = this.constructPosition(request, pieceId, pieceName,
				null, null);
		if (pieceId != null) {
			position += "<a href=\"" + request.getContextPath()
					+ "/forum/topic.do?action=hotTopic&pieceId=" + pieceId
					+ "\">熱門主題</a>";
		} else {
			position += "<a href=\"" + request.getContextPath()
					+ "/forum/topic.do?action=hotTopic\">熱門主題</a>";
		}
		List<ForumTopic> list = El.getEl().getTopicMgr().getHotTopic(pieceId,
				null, topicCount);
		this.setAttribute(request, "position", position);
		this.setAttribute(request, "topicCount", topicCount);
		this.setAttribute(request, "topicList", list);

		return mapping.findForward("hotTopic");
	}

	/**
	 * 
	 * 返回新發的帖子
	 * 
	 * 1, 返回的是全部的新帖子(分頁) 2, 返回的是piece下面的帖子
	 * 
	 * @return ActionForward
	 */
	@Override
	protected ActionForward newPostTopic(ActionMapping mapping,
			ActionForm form, HttpServletRequest request,
			HttpServletResponse response) {
		Integer pieceId = this.getPieceId(request);
		String pieceName = null;
		if (pieceId != null) {
			pieceName = El.getEl().getTopicMgr().getForumPieceById(pieceId)
					.getName();
			this.setAttribute(request, "pieceId", pieceId);
		}
		List<ForumTopic> list = El.getEl().getTopicMgr().getNewPostTopic(
				pieceId, null, Constents.newPostTopicPageSize);
		String position = this.constructPosition(request, pieceId, pieceName,
				null, null);
		if (pieceId != null) {
			position += "<a href=\"" + request.getContextPath()
					+ "/forum/topic.do?action=newPostTopic&pieceId=" + pieceId
					+ "\">新帖</a>";
		} else {
			position += "<a href=\"" + request.getContextPath()
					+ "/forum/topic.do?action=newPostTopic\">新帖</a>";
		}

		this.setAttribute(request, "position", position);
		this.setAttribute(request, "topicList", list);
		this.setAttribute(request, "pageSize", Constents.newPostTopicPageSize);
		this.setAttribute(request, "topicCount", Constents.newPostTopicCount);
		return mapping.findForward("newPostTopic");
	}

	/**
	 * 1)查詢 搜索
	 */
	@Override
	protected ActionForward search(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) {
		
		//總頁數
		Integer pageCount = 0;
		//頁碼大小
		Integer pageSize = Constents.searchPageSize;
		//送搜索出來的記錄
		Integer topicCount = 0;
		//當前頁面
		Integer page = this.getPage(request);//如果< 0 則為1

		//獲取數據
		String pieceName = null;
		Integer hotReal = null; // 全部范圍,1最新,2新華
		Integer moduleId = this.getModuleId(request);
		Integer pieceId = this.getPieceId(request);
		Integer topicId = this.getTopicId(request);
		Integer precision = 2; // 模糊搜索
		
		if (pieceId != null && pieceId > 0) {
			Forumpiece fe = El.getEl().getTopicMgr().getForumPieceById(pieceId);
			pieceName = fe == null ? "" : fe.getName();
		}
		String position = this.constructPosition(request, pieceId, pieceName,
				null, null);
		if (pieceId != null && pieceId > 0) {
			position += "<a href=\"" + request.getContextPath()
					+ "/forum/topic.do?action=search&pieceId=" + pieceId
					+ "\">論壇搜索</a>";
		} else {
			position += "<a href=\"" + request.getContextPath()
					+ "/forum/topic.do?action=search\">論壇搜索</a>";
		}
		String isSearch = request.getParameter("isSearch");
		String fastSearch = request.getParameter("fastSearch");
		// 獲取module,piece信息,以用于在JSP中的select控件使用
		List<Forummodule> listModule = El.getEl().getTopicMgr().getModule();
		List<Forumpiece> listPiece = El.getEl().getTopicMgr().getpiece();

		// 快速搜索
		if ("true".equals(fastSearch)) {
			String keyword = request.getParameter("keyword");
			String topicName = keyword;
			String author = null;
			Timestamp startTime = null;
			Timestamp endTime = null;
			
			Map<String, Object> map = null;
			List<ForumTopic> listTopic = null;
			
			if (topicName != null && !"".equals(topicName.trim())) {
				 map = El.getEl().getTopicMgr().search(moduleId, pieceId,
						topicId, hotReal, topicName, author, startTime,
						endTime, precision, page, pageSize);
				 if(map != null) {
					 listTopic = (List<ForumTopic>) map.get("listTopic");
					 topicCount = (Integer) map.get("topicCount");
					 page = (Integer) map.get("page");
					 pageSize = (Integer) map.get("pageSize");
					 pageCount = (Integer) map.get("pageCount");
				 }
			} else {
				ActionErrors errors = new ActionErrors();
				errors.add("", new ActionError("search keyword must not null"));
				saveErrors(request, errors);
			}

			this.setAttribute(request, "position", position);
			this.setAttribute(request, "listModule", listModule);
			this.setAttribute(request, "listPiece", listPiece);
			this.setAttribute(request, "listTopic", listTopic);
			this.setAttribute(request, "pieceId", pieceId);
			this.setAttribute(request, "moduleId", moduleId);
			this.setAttribute(request, "topicId", topicId);
			this.setAttribute(request, "page", page);
			this.setAttribute(request, "pageSize", pageSize);
			this.setAttribute(request, "topicCount", topicCount);
			this.setAttribute(request, "hotReal", hotReal);
			
			return mapping.findForward("search");
		}
		// 1
		if ("true".equals(isSearch)) {

			if (request.getParameter("precision") != null) {
				precision = Integer.valueOf(request.getParameter("precision"));
			}
			if (request.getParameter("topic") != null
					&& !"".equals(request.getParameter("topic").trim())) {
				topicId = Integer.valueOf(request.getParameter("topic"));
			}
			
			if (request.getParameter("hotReal") != null
					&& !"".equals((request.getParameter("hotReal").trim()))) {
				hotReal = Integer.valueOf(request.getParameter("hotReal"));
			}
			String topicName = null;
			if (request.getParameter("topicName") != null
					&& !"".equals((request.getParameter("topicName").trim()))) {
				topicName = request.getParameter("topicName");
			}
			String author = null;
			if (request.getParameter("author") != null
					&& !"".equals((request.getParameter("author").trim()))) {
				author = request.getParameter("author");
			}

			Timestamp startTime = this.createTimestamp(request, 1);
			Timestamp endTime = this.createTimestamp(request, 2);
			System.out.println("topic moduleId " + moduleId);
			System.out.println("topic pieceId " + pieceId);
			System.out.println("topic topicId " + topicId);
			System.out.println("topic topicName " + topicName);
			System.out.println("topic author " + author);
			System.out.println("topic hotReal " + hotReal);
			if ((moduleId == null || -1 == moduleId)
					&& (pieceId == null || -1 == pieceId ) && topicId == null
					&& topicName == null 
					&& author == null
					&& (hotReal == null|| -1 == hotReal)) {
				ActionErrors errors = new ActionErrors();
				errors.add("", new ActionError("choose a one"));
				saveErrors(request, errors);
				this.setAttribute(request, "position", position);
				this.setAttribute(request, "listModule", listModule);
				this.setAttribute(request, "listPiece", listPiece);
				this.setAttribute(request, "moduleId", moduleId);
				this.setAttribute(request, "topicId", topicId);
				this.setAttribute(request, "pieceId", pieceId);
				this.setAttribute(request, "page", page);
				this.setAttribute(request, "pageSize", pageSize);
				this.setAttribute(request, "topicCount", topicCount);
				this.setAttribute(request, "hotReal", hotReal);
				
				return mapping.findForward("search");
			}
			Map<String, Object> map = El.getEl().getTopicMgr().search(
					moduleId, pieceId, topicId, hotReal, topicName, author,
					startTime, endTime, precision, page, pageSize);
			List<ForumTopic> listTopic = null;
			if(map != null) {
				System.out.println("sdfsdfsdfsdfdsfsfds");
				listTopic = (List<ForumTopic>) map.get("listTopic");
				topicCount = (Integer) map.get("topicCount");
				page = (Integer) map.get("page");
				pageSize = (Integer) map.get("pageSize");
				pageCount = (Integer) map.get("pageCount");
			}
			
			System.out.println("topicCount::" + topicCount);
			this.setAttribute(request, "position", position);
			this.setAttribute(request, "listModule", listModule);
			this.setAttribute(request, "listPiece", listPiece);
			this.setAttribute(request, "listTopic", listTopic);
			this.setAttribute(request, "pieceId", pieceId);
			this.setAttribute(request, "moduleId", moduleId);
			this.setAttribute(request, "topicId", topicId);
			this.setAttribute(request, "page", page);
			this.setAttribute(request, "pageSize", pageSize);
			this.setAttribute(request, "topicCount", topicCount);
			this.setAttribute(request, "hotReal", hotReal);
			
			return mapping.findForward("search");
		}

		this.setAttribute(request, "position", position);
		this.setAttribute(request, "listModule", listModule);
		this.setAttribute(request, "listPiece", listPiece);
		this.setAttribute(request, "pieceId", pieceId);
		this.setAttribute(request, "moduleId", moduleId);
		this.setAttribute(request, "topicId", topicId);
		this.setAttribute(request, "topicCount", topicCount);
		this.setAttribute(request, "page", page);
		this.setAttribute(request, "pageSize", pageSize);
		this.setAttribute(request, "hotReal", hotReal);
		
		return mapping.findForward("search");
	}

	@Override
	protected ActionForward essence(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) {
		Integer pageSize = Constents.essencePageSize;
		Integer topicCount = 0;
		String pieceName = null;
		Integer pieceId = this.getPieceId(request); // 有可能返回的是空的值
		if (pieceId != null) {
			pieceName = El.getEl().getTopicMgr().getForumPieceById(pieceId)
					.getName();
			this.setAttribute(request, "pieceId", pieceId);
		}
		String position = this.constructPosition(request, pieceId, pieceName,
				null, null);
		if (pieceId != null) {
			position += "<a href=\"" + request.getContextPath()
					+ "/forum/topic.do?action=essence&pieceId=" + pieceId
					+ "\">精華帖子</a>";
		} else {
			position += "<a href=\"" + request.getContextPath()
					+ "/forum/topic.do?action=essence\">精華帖子</a>";
		}
		List<ForumTopic> listEssenceTopic = El.getEl().getTopicMgr()
				.getEssenceTopic(pieceId);
		topicCount = null != listEssenceTopic ? listEssenceTopic.size() : 0;

		this.setAttribute(request, "position", position);
		this.setAttribute(request, "pageSize", pageSize);
		this.setAttribute(request, "topicCount", topicCount);
		this.setAttribute(request, "listEssenceTopic", listEssenceTopic);

		return mapping.findForward("essence");
	}

	@Override
	public ActionForward execute(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws Exception {
		return super.execute(mapping, form, request, response);
	}

}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩精品一区国产麻豆| 欧美人狂配大交3d怪物一区| 午夜精品视频在线观看| 国产欧美日韩综合精品一区二区| 在线欧美一区二区| 懂色av一区二区三区免费看| 日韩国产精品久久久久久亚洲| 中文av字幕一区| 精品国产一区二区国模嫣然| 欧美精品 日韩| 色先锋久久av资源部| 国产盗摄女厕一区二区三区| 免费在线看一区| 一区二区久久久久| 国产精品久久99| 国产亚洲va综合人人澡精品| 欧美一区二区福利在线| 欧美日韩在线亚洲一区蜜芽| 99国产精品99久久久久久| 精品亚洲国内自在自线福利| 日韩国产精品久久| 亚洲综合成人在线| 1区2区3区欧美| 国产精品无圣光一区二区| 久久九九久久九九| 欧美第一区第二区| 欧美va在线播放| 欧美一级在线观看| 制服.丝袜.亚洲.另类.中文| 欧美性视频一区二区三区| 色94色欧美sute亚洲线路二| 99这里只有久久精品视频| aaa国产一区| 99久久综合99久久综合网站| a4yy欧美一区二区三区| 99久久久久久| 色拍拍在线精品视频8848| 色综合天天天天做夜夜夜夜做| 99麻豆久久久国产精品免费优播| a亚洲天堂av| 91看片淫黄大片一级在线观看| proumb性欧美在线观看| 91在线视频观看| 成人av先锋影音| 99精品久久久久久| 欧美影院一区二区| 欧美猛男超大videosgay| 在线不卡中文字幕播放| 91精品国产免费| 日韩女同互慰一区二区| 久久精品夜夜夜夜久久| 国产欧美一区二区精品秋霞影院| 国产精品乱码人人做人人爱| 亚洲免费资源在线播放| 亚洲成人免费影院| 久久av老司机精品网站导航| 国产一区二区三区不卡在线观看| 成人一区二区在线观看| 色婷婷综合视频在线观看| 欧美亚洲国产一区在线观看网站 | 国产丝袜美腿一区二区三区| 欧美韩日一区二区三区| ...xxx性欧美| 日韩激情av在线| 国产精品白丝jk黑袜喷水| 91色婷婷久久久久合中文| 欧美在线视频日韩| 欧美成人精品3d动漫h| 国产亚洲成年网址在线观看| 亚洲欧美一区二区三区国产精品| 天堂一区二区在线| 国产一区在线不卡| 色香蕉成人二区免费| 欧美岛国在线观看| 中文字幕一区三区| 毛片一区二区三区| 不卡av在线网| 欧美一区二区三区视频在线 | 国精品**一区二区三区在线蜜桃| 国产成人免费视| 欧美曰成人黄网| 久久久久久久久蜜桃| 一区二区三区产品免费精品久久75| 蜜臀av一区二区在线免费观看 | 777精品伊人久久久久大香线蕉| 久久久久久久久久久99999| 亚洲桃色在线一区| 青青草原综合久久大伊人精品| 大白屁股一区二区视频| 欧美福利视频一区| ...xxx性欧美| 韩国欧美国产一区| 欧美色图一区二区三区| 国产蜜臀av在线一区二区三区| 亚洲自拍偷拍av| 成人黄页毛片网站| 欧美一二区视频| 亚洲一区国产视频| 福利电影一区二区| 欧美一级黄色录像| 自拍偷拍亚洲综合| 国产精品99久久久久久久女警| 欧美日韩卡一卡二| 亚洲婷婷在线视频| 国产精品一区二区x88av| 欧美一级片在线观看| 亚洲美女偷拍久久| 国产99久久久久| 久久综合99re88久久爱| 日韩高清在线电影| 欧美探花视频资源| 综合久久久久久久| 国产91精品一区二区麻豆亚洲| 日韩午夜av电影| 天天综合日日夜夜精品| 在线欧美日韩国产| 1区2区3区欧美| 成人免费毛片app| 久久九九久精品国产免费直播| 久久国产夜色精品鲁鲁99| 正在播放一区二区| 午夜一区二区三区在线观看| 色国产综合视频| 亚洲色图视频免费播放| 成年人网站91| 国产精品国产三级国产普通话99| 国产米奇在线777精品观看| 精品国产成人系列| 激情六月婷婷综合| 精品1区2区在线观看| 裸体歌舞表演一区二区| 日韩欧美国产成人一区二区| 美女视频免费一区| 欧美一区午夜视频在线观看| 日韩成人免费在线| 9191久久久久久久久久久| 亚洲综合图片区| 欧美日韩一卡二卡三卡| 天天影视涩香欲综合网| 日韩欧美国产系列| 国产一区二区美女| 欧美国产视频在线| 99r国产精品| 亚洲午夜免费电影| 在线综合视频播放| 美女网站在线免费欧美精品| 精品久久久久99| 国产一区二区三区在线看麻豆| 久久综合狠狠综合| 成人动漫在线一区| 亚洲精品乱码久久久久久| 精品视频一区三区九区| 日本不卡视频一二三区| 精品精品国产高清一毛片一天堂| 精品一区二区久久久| 日本一区二区三区在线不卡| 91美女片黄在线观看91美女| 夜夜嗨av一区二区三区网页| 欧美精品电影在线播放| 韩国成人在线视频| 亚洲欧美在线aaa| 欧美体内she精高潮| 精品一区二区国语对白| 中文字幕日本乱码精品影院| 欧美影片第一页| 精品一区二区三区影院在线午夜| 国产精品久久久一本精品 | 蜜臀久久99精品久久久画质超高清| 精品裸体舞一区二区三区| 成人精品电影在线观看| 一区二区三区四区五区视频在线观看 | 久久精品噜噜噜成人av农村| 国产色产综合色产在线视频 | 欧美精品三级日韩久久| 国产一区二区在线影院| 亚洲欧美日韩综合aⅴ视频| 91精品国产免费久久综合| 成人免费毛片片v| 天堂午夜影视日韩欧美一区二区| 久久久国产午夜精品| 欧美中文字幕一二三区视频| 精品无人码麻豆乱码1区2区 | 亚洲三级久久久| 欧美一区二区在线视频| 成人午夜看片网址| 三级不卡在线观看| 综合久久国产九一剧情麻豆| 欧美一级片免费看| 91片在线免费观看| 精品一区二区免费视频| 亚洲在线观看免费| 中文无字幕一区二区三区| 欧美日韩一区在线| heyzo一本久久综合| 激情综合网av| 亚洲成av人片在线| 亚洲色欲色欲www| 国产欧美一区二区精品久导航| 91精品在线一区二区| 91福利精品第一导航|