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

📄 publishmaintopicaction.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-15-2008
 * 
 * XDoclet definition:
 * 
 * @struts.action validate="true"
 */
public class PublishMainTopicAction 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 title = request.getParameter("title");
		log.debug("title:" + title);
		String content = request.getParameter("content");
		log.debug("content:" + content);

		User u = (User) request.getSession().getAttribute("nowuser");
		String result="success";
		try {
			topicService.publishNewMainTopic(title, content, u);
			log.info("user publish new main topic");
		} catch (ItalkSecurityException e) {
			log.debug("publish error");
			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 error", e);
			}
		}
		return null;
	}
}

⌨️ 快捷键说明

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