productstyleaction.java

来自「巴巴运动网源码 传智博客出品 不全 一部分代码 可以参考」· Java 代码 · 共 39 行

JAVA
39
字号
package com.itcast.web.action.product;

import java.util.LinkedHashMap;

import javax.annotation.Resource;
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 org.springframework.stereotype.Controller;

import com.itcast.bean.product.ProductStyle;
import com.itcast.service.product.ProductStyleService;
import com.itcast.web.formbean.product.ProductForm;

@Controller("/control/product/style/list")
public class ProductStyleAction extends Action {
	@Resource(name="productStyleServiceBean")
	private ProductStyleService productStyleService;

	@Override
	public ActionForward execute(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws Exception {
		ProductForm formbean = (ProductForm) form;
		LinkedHashMap<String, String> orderby = new LinkedHashMap<String, String>();
		orderby.put("visible", "desc");
		orderby.put("id", "asc");
		request.setAttribute("styles", productStyleService.getScrollData(ProductStyle.class, -1, -1,
				"o.product.id=?1", new Object[]{formbean.getProductid()},orderby).getResultlist());
		return mapping.findForward("list");
	}
	
	
}

⌨️ 快捷键说明

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