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

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

import news.News;

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: 05-26-2008
 * 
 * XDoclet definition:
 * @struts.action validate="true"
 * @struts.action-forward name="doedit" path="/doedit.jsp"
 */
public class DoEditAction 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"));
		News news = new DBConn().showNews(id);
		//request.setAttribute("shownews", news);
		request.getSession().setAttribute("shownews", news);
		return mapping.findForward("doedit");
	}
}