/*
 * Generated by MyEclipse Struts
 * Template path: templates/java/JavaClass.vtl
 */
package cn.jack.struts;

import java.util.List;

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 cn.jack.service.SearchDao;

/** 
 * MyEclipse Struts
 * Creation date: 05-14-2007
 * 
 * XDoclet definition:
 * @struts.action path="/search" name="searchForm" input="/WEB-INF/JSP/s.jsp" scope="request"
 */
public class SearchAction extends Action {
	private SearchDao sdao;
	/*
	 * 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) {
		SearchForm sf = (SearchForm) form;// TODO Auto-generated method stub
		String keyword=sf.getKeyword();
		String where =sf.getWhere();
		List alls = sdao.search(keyword, where);
		request.setAttribute("alls",alls);
		return mapping.findForward("searchlist");
	}

	public SearchDao getSdao() {
		return sdao;
	}

	public void setSdao(SearchDao sdao) {
		this.sdao = sdao;
	}
}