[/code]- package cn.mu.web.action.product;
- 这个是sturts1.3的action代码 其他模块测试正常
- 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 cn.mu.bean.PageIndex;
- import cn.mu.bean.PageView;
- import cn.mu.bean.QueryResult;
- import cn.mu.bean.WebTool;
- import cn.mu.bean.product.ProductType;
- import cn.mu.service.product.ProductTypeService;
- import cn.mu.web.formbean.product.ProductTypeForm;
- @Controller("/control/product/type/list")
- public class ProductTypeAction extends Action {
- @Resource(name="productTypeServiceBean")
- private ProductTypeService productTypeService;
-
- @Override
- public ActionForward execute(ActionMapping mapping, ActionForm form,
- HttpServletRequest request, HttpServletResponse response)
- throws Exception {
- ProductTypeForm formbean=(ProductTypeForm)form;
- PageView<ProductType> pageView=new PageView<ProductType>(12, formbean.getPage());
-
- int firstindex=(pageView.getCurrentpage()-1)*pageView.getMaxresult();
- LinkedHashMap<String, String>orderby=new LinkedHashMap<String,String>();
- orderby.put("typeid", "desc");
- QueryResult<ProductType>qr=productTypeService.getScrollData(ProductType.class, firstindex, pageView.getMaxresult(), "o.visible=?1", new Object[]{true}, orderby);
-
- pageView.setQueryResult(qr);
-
-
- request.setAttribute("pageView",pageView);
-
- return mapping.findForward("list");
- }
-
- }
复制代码 |
|