⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 warequerydaction.java

📁 一个java写的网上购物系统
💻 JAVA
字号:
/*
 * Generated by MyEclipse Struts
 * Template path: templates/java/JavaClass.vtl
 */
package com.hb.myshop.struts.action;

import java.util.ArrayList;
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 com.hb.myshop.idao.IWareDAO;
import com.hb.myshop.struts.form.WareForm;
import com.hb.myshop.tools.PageController;



/** 
 * MyEclipse Struts
 * Creation date: 10-11-2008
 * 
 * XDoclet definition:
 * @struts.action path="/ware" name="wareForm" input="/JSP/ware.jsp" scope="request" validate="true"
 */
public class WareQuerydAction extends Action {
	/*
	 * Generated Methods
	 */
	 private IWareDAO iwareDao;
	
	public IWareDAO getIwareDao() {
		return iwareDao;
	}

	public void setIwareDao(IWareDAO iwareDao) {
		this.iwareDao = iwareDao;
	}

	/** 
	 * Method execute
	 * @param mapping
	 * @param form
	 * @param request
	 * @param response
	 * @return ActionForward
	 */
	public ActionForward execute(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) {
		WareForm s=(WareForm)form;
		String sortid=s.getSortid();
		String wareid=s.getWareid();
		String warename=s.getWarename();
		String wareprice=s.getWareprice();
		IWareDAO iwareDAo=this.getIwareDao();
		List list=new ArrayList();
		if(sortid==null&&wareid==null&&warename==null&&wareprice==null)
		{
			list=iwareDAo.getAllWares();
		}
		else
		{
			list=iwareDAo.getWares(sortid, warename, wareid, wareprice);
		}
		String pageIndex = request.getParameter("pageIndex");
		if(pageIndex == null)
		{
			pageIndex = "1";
		}
		PageController pc = (PageController) request.getAttribute("pc");
		if (pc == null)
		{
			pc = new PageController();
			pc.setBigList(list);
			request.setAttribute("pc", pc);
		}
		pc.setCurrentPageIndex(Integer.parseInt(pageIndex));
		return new ActionForward("/JSP/ware.jsp");
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -