📄 publishreplytopicaction.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 + -