文件名称:
20111009_maven3+S3S2JPA2_nullPointError_babasportrefactoring
开发工具:
文件大小: 101kb
下载次数: 0
上传时间: 2015-01-09
详细说明:
package com.itcast.web.action.product; import com.itcast.bean.QueryResult; import com.itcast.bean.product.ProductType; import com.itcast.service.product.ProductTypeService; import java.util.List; import javax.annotation.Resource; import org.springframework.stereotype.Controller; @Controller("/control/product/type/JsonTable") public class JsonTable { //Your result List private List gridModel; //get how many rows we want to have into the grid - rowNum attribute in the grid private In teger rows = 10; //Get the requested page. By default grid sets this to 1. private Integer page = 1; // sorting order - asc or desc private String sord; // get index row - i.e. user click to sort. private String sidx; // Search Field private String searchField; // The Search String private String searchString; // he Search Operation ['eq','ne','lt','le','gt','ge','bw','bn','in','ni','ew','en','cn','nc'] private String searchOper; // Your Total Pages private Integer total = 0; // All Record private Integer records = 0; @Resource(name = "productTypeServiceBean") private ProductTypeService productTypeService; public String execute() { int to = (getRows() * getPage()); int from = to - getRows(); QueryResult qr = productTypeService.getScrollData( ProductType.class, from, to, "o.visible=?1", new Object[]{true}); setRecords((Integer) qr.getTotalrecord().intValue()); setGridModel(qr.getResultlist()); //calculate the total pages for the query setTotal((Integer) (int) Math.ceil((double) getRecords() / (double) getRows())); return "success"; } public String getJSON() { return execute(); } /** * @return the gridModel */ public List getGridModel() { return gridModel; } /** * @param gridModel the gridModel to set */ public void setGridModel(List gridModel) { this.gridModel = gridModel; } /** * @return the rows */ public Integer getRows() { return rows; } /** * @param rows the rows to set */ public void setRows(Integer rows) { this.rows = rows; } /** * @return the page */ public Integer getPage() { return page; } /** * @param page the page to set */ public void setPage(Integer page) { this.page = page; } /** * @return the sord */ public String getSord() { return sord; } /** * @param sord the sord to set */ public void setSord(String sord) { this.sord = sord; } /** * @return the sidx */ public String getSidx() { return sidx; } /** * @param sidx the sidx to set */ public void setSidx(String sidx) { this.sidx = sidx; } /** * @return the searchField */ public String getSearchField() { return searchField; } /** * @param searchField the searchField to set */ public void setSearchField(String searchField) { this.searchField = searchField; } /** * @return the searchString */ public String getSearchString() { return searchString; } /** * @param searchString the searchString to set */ public void setSearchString(String searchString) { this.searchString = searchString; } /** * @return the searchOper */ public String getSearchOper() { return searchOper; } /** * @param searchOper the searchOper to set */ public void setSearchOper(String searchOper) { this.searchOper = searchOper; } /** * @return the total */ public Integer getTotal() { return total; } /** * @param total the total to set */ public void setTotal(Integer total) { this.total = total; } /** * @return the records */ public Integer getRecords() { return records; } /** * @param records the records to set */ public void setRecords(Integer records) { this.records = records; } //Getters and Setters for Attributes } ...展开收缩
(系统自动生成,下载前可以参看下载内容)
下载文件列表
相关说明
- 本站资源为会员上传分享交流与学习,如有侵犯您的权益,请联系我们删除.
- 本站是交换下载平台,提供交流渠道,下载内容来自于网络,除下载问题外,其它问题请自行百度。
- 本站已设置防盗链,请勿用迅雷、QQ旋风等多线程下载软件下载资源,下载后用WinRAR最新版进行解压.
- 如果您发现内容无法下载,请稍后再次尝试;或者到消费记录里找到下载记录反馈给我们.
- 下载后发现下载的内容跟说明不相乎,请到消费记录里找到下载记录反馈给我们,经确认后退回积分.
- 如下载前有疑问,可以通过点击"提供者"的名字,查看对方的联系方式,联系对方咨询.