goodsaction.java

来自「本系统是一个网上拍卖系统」· Java 代码 · 共 71 行

JAVA
71
字号
/*
 * Generated by MyEclipse Struts
 * Template path: templates/java/JavaClass.vtl
 */
package y2ssh.xzh.web.action;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;


import y2ssh.xzh.biz.GoodsBiz;

import y2ssh.xzh.biz.impl.GoodsBizImpl;
import y2ssh.xzh.entity.Goods;

import y2ssh.xzh.web.form.GoodsForm;

/** 
 * MyEclipse Struts
 * Creation date: 08-27-2007
 * 
 * XDoclet definition:
 * @struts.action path="/goods" name="goodsForm" parameter="operate" scope="request"
 */
public class GoodsAction extends BaseAction {
	/*
	 * Generated Methods
	 */
	private GoodsBiz goodsBiz = null;//new GoodsBizImpl();

	public ActionForward toAdd(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) {
		return mapping.findForward("add_goods");
	}
	
	public ActionForward doAdd(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) {
		GoodsForm goodsForm = (GoodsForm) form;
		Goods item = goodsForm.getItem();
		this.goodsBiz.addGoods(item,(super.getCurrUserId(request)).longValue());
		return mapping.findForward("index");
	}
	
	public ActionForward toOnSaleGoodsList(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) {
		List list = this.goodsBiz.getOnSaleGoodsList();
		request.setAttribute("list", list);
		return mapping.findForward("on_sale_list");
	}
	
	public ActionForward toMyGoodsList(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) {
		Long userId = super.getCurrUserId(request);
		List list = this.goodsBiz.getMyGoodsList(userId);
		request.setAttribute("list", list);
		return mapping.findForward("my_goods_list");
	}

	public GoodsBiz getGoodsBiz() {
		return goodsBiz;
	}

	public void setGoodsBiz(GoodsBiz goodsBiz) {
		this.goodsBiz = goodsBiz;
	}
}

⌨️ 快捷键说明

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