/*
 * Generated by MyEclipse Struts
 * Template path: templates/java/JavaClass.vtl
 */
package admin.guest;

import java.sql.Timestamp;

import guestbook.GuestBook;

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 database.DBConn;

/** 
 * MyEclipse Struts
 * Creation date: 07-23-2008
 * 
 * XDoclet definition:
 * @struts.action validate="true"
 * @struts.action-forward name="ok" path="/1.jsp"
 */
public class DOReGuestAction 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) {
		int id = Integer.parseInt(request.getParameter("id"));
		String recontent = request.getParameter("recontent");
		GuestBook gb = new GuestBook();
		java.util.Date date=new java.util.Date();
		String datetime=new Timestamp(date.getTime()).toString();
		gb.setRemydate(datetime);
		gb.setId(id);
		gb.setRecontent(recontent);
		DBConn db = new DBConn();
		db.reGuest(gb);
		return mapping.findForward("ok");
	}
}