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

📄 publishreplytopicaction.java

📁 Italk吧简易论坛 基于struts+extjs+hibernate+spring+mysql开发。 /catch目录为系统截图 安装步骤: 1:安装MYSQL
💻 JAVA
字号:
/*
 * Generated by MyEclipse Struts
 * Template path: templates/java/JavaClass.vtl
 */
package com.italk.action;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import com.italk.service.security.ItalkSecurityException;
import com.italk.vo.User;

/**
 * MyEclipse Struts Creation date: 11-16-2008
 * 
 * XDoclet definition:
 * 
 * @struts.action validate="true"
 */
public class PublishReplyTopicAction extends BaseAction {
	/*
	 * Generated Methods
	 */

	/**
	 * Method execute
	 * 
	 * @param mapping
	 * @param form
	 * @param request
	 * @param response
	 * @return ActionForward
	 */
	public ActionForward execute(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) {
		// TODO Auto-generated method stub
		String topicId = request.getParameter("topicId");
		log.debug("topicId:" + topicId);

		String content = request.getParameter("content");
		log.debug("content:" + content);

		String result = "success";
		User u = (User) request.getSession().getAttribute("nowuser");
		try {
			boolean isReply=topicService.publishNewReplyTopic(u, topicId, content);
			log.info("publish new reply topic");
			if(!isReply) {
				result="isLock";
			}
		} catch (ItalkSecurityException e) {
			log.debug("publish failed");
			result = "right";
		} finally {
			response.setContentType("text/xml");
			try {
				PrintWriter out = response.getWriter();
				out.print("<results><result>"+result+"</result></results>");
				out.flush();
				out.close();
			} catch (IOException e) {
				log.error("publish reply error", e);
			}
		}
		// Topic t=(Topic) topicService.getTdao().getById(Long.decode(topicId));
		// log.debug("-------->");
		// log.debug("publishTime:"+t.getPublishTime());
		// log.debug("-------->");

		return null;
	}
}

⌨️ 快捷键说明

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