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

📄 bugaddaction.java

📁 Struts+Hibernate实现软件缺陷的跟踪管理
💻 JAVA
字号:
/*
 * Generated by MyEclipse Struts
 * Template path: templates/java/JavaClass.vtl
 */
package xing.five.struts.action;

import java.util.Date;

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

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 xing.five.beans.FollowInf;
import xing.five.beans.FollowInfDAO;
import xing.five.beans.WorngInf;
import xing.five.beans.WorngInfDAO;

/** 
 * MyEclipse Struts
 * Creation date: 01-16-2008
 * 
 * XDoclet definition:
 * @struts.action path="/bugAdd" name="bugAddForm" input="/bugAdd.jsp" scope="request" validate="true"
 */
public class BugAddAction extends Action {
	/*
	 * 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) {
		//提交到缺陷表中
		WorngInf bugAdd= (WorngInf) form;// TODO Auto-generated method stub
		Date date=new Date();
		Integer id=new Integer(request.getSession().getAttribute("pid").toString());
		bugAdd.setBDate(date);
		System.out.print(id);
		bugAdd.setPelId(id);
		WorngInfDAO dao=new WorngInfDAO();
		dao.save(bugAdd);
		//保存缺陷名称到session中
		String worngname=new String(bugAdd.getWorngName());
		request.getSession().setAttribute("worngname", worngname);
		
		
		//提交到缺陷跟踪表中
		FollowInf follow=new FollowInf();
		follow.setName(bugAdd.getWorngName());
		follow.setId(bugAdd.getId());
		follow.setTjDate(date);
		follow.setState("已提交");
		follow.setTjPeople(request.getSession().getAttribute("pname").toString());
		FollowInfDAO fdao=new FollowInfDAO();
		fdao.save(follow);
		return mapping.findForward("success");
	}
}

⌨️ 快捷键说明

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