📄 upreplyaction.java
字号:
package com.ntsky.bbs.action;import org.apache.struts.action.*;import javax.servlet.http.*;import org.apache.log4j.Logger ;import org.apache.commons.beanutils.PropertyUtils;import com.ntsky.bbs.action.Constant;import com.ntsky.bbs.service.Reply;import com.ntsky.bbs.service.db.DBReply;import com.ntsky.bbs.service.TopicUtil;import com.ntsky.bbs.service.ReplyFactory;import com.ntsky.bbs.form.ReplyActionForm;/** * <p>Title: Ntsky OpenSource BBS</p> * <p>Description: </p> * <p>Copyright: Copyright (c) 2004</p> * <p>Company: WWW.FM880.COM</p> * @author 姚君林 * @version 1.0 */public class UpReplyAction extends Action { private final static Logger logger = Logger.getLogger(UpReplyAction.class); public ActionForward execute(ActionMapping actionMapping, ActionForm actionForm, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws Exception{ /**@todo: complete the business logic here, this is just a skeleton.*/ ReplyActionForm topicActionForm = (ReplyActionForm) actionForm; String action = httpServletRequest.getParameter("action"); String boaId = httpServletRequest.getParameter("boaId"); ReplyFactory replyFactory = ReplyFactory.getInstance(); Reply reply = new DBReply(); PropertyUtils.copyProperties(reply ,topicActionForm); /** * 回复主题情况 */ if((Constant.CREATE).equals(action)){ replyFactory.insReply(reply); int topicId = reply.getRepTopicId(); httpServletRequest.setAttribute("action","createReply"); //httpServletRequest.setAttribute("topic",TopicUtil.listTopic(reply.getRepTopicId())); httpServletRequest.setAttribute("topicId",String.valueOf(topicId)); httpServletRequest.setAttribute("boaId",boaId); logger.info("回复主题成功!"); return actionMapping.findForward("success"); } if((Constant.EDIT).equals(action)){ replyFactory.upReply(reply); httpServletRequest.setAttribute("action","editReply"); httpServletRequest.setAttribute("topicId",String.valueOf(reply.getRepTopicId())); return actionMapping.findForward("success"); } return actionMapping.findForward("continue"); //throw new java.lang.UnsupportedOperationException("Method perform() not yet implemented."); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -