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

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

import link.Link;

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-24-2008
 * 
 * XDoclet definition:
 * @struts.action path="/addlink" name="link" scope="request" validate="true"
 * @struts.action-forward name="ok" path="/admin/addlink.jsp"
 */
public class AddLinkAction 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) {
		AddLinkForm link = (AddLinkForm) form;// TODO Auto-generated method stub
		Link l = new Link();
		l.setAddr(link.getAddr());
		l.setTitle(link.getTitle());
		new DBConn().addLink(l);
		return mapping.findForward("ok");
	}
}