?? bugaddaction.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 + -