hfcontrol.java

来自「java带进度条上传尽量不要让站长把时间都花费在为您修正说明上」· Java 代码 · 共 79 行

JAVA
79
字号
/*
 * Generated by MyEclipse Struts
 * Template path: templates/java/JavaClass.vtl
 */
package com.jmwl.control;

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

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

import com.jmwl.biz.NotesSerivce;
import com.jmwl.biz.ReplyService;
import com.jmwl.common.BlogException;
import com.jmwl.dao.NowTime;
import com.jmwl.dto.UserReplyDTO;
import com.jmwl.form.HfForm;

/** 
 * MyEclipse Struts
 * Creation date: 08-27-2008
 * 
 * XDoclet definition:
 * @struts.action path="/hf" name="hfForm" input="/note/hf.jsp" scope="request" validate="true"
 */
public class HfControl extends Action {
	/*
	 * Generated Methods
	 */

	/** 
	 * Method execute
	 * @param mapping
	 * @param form
	 * @param request
	 * @param response
	 * @return ActionForward
	 * @throws BlogException 
	 */
	public ActionForward execute(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) throws BlogException {
		HfForm hfForm = (HfForm) form;// TODO Auto-generated method stub
		String content=hfForm.getTe();
		String n=hfForm.getId();
		int id=Integer.parseInt(n);
		ReplyService db=new ReplyService();
		NowTime time=new NowTime();
		UserReplyDTO info=new UserReplyDTO();
		info.setCountent(content);
		info.setNote_id(id);
		info.setPub_time(time.disTime2());
		HttpSession session=request.getSession();
		
		
		int userid=(Integer)session.getAttribute("uid");
		info.setUser_id(userid);
		
		boolean b=db.addreply(info);
		System.out.println("日志的id为"+info.getNote_id());
		request.setAttribute("nnid", info.getNote_id());
		if(b)
		{
			NotesSerivce note=new NotesSerivce();
			boolean a=note.add_hf_jf(info.getUser_id());
			request.setAttribute("b", "5");
			return mapping.findForward("dis");
		}
		else
		{
			request.setAttribute("b", "6");
			return mapping.findForward("dis");
		}
		
	}
}

⌨️ 快捷键说明

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