package com.zzwtec.third.common;

import javax.servlet.http.HttpServletRequest;

public class PageIndexHelper {
	
	/**
	 * 设置分页条信息
	 */
	public static void setPaging(HttpServletRequest request, Page<?> page){
		PageIndex pageIndex;
		if(page!=null && page.getPage()!=null){
			pageIndex = PageIndex.getPageIndex(Pageing.PAGINATION_SIZE, page.getPage(), page.getTotal());
		} else {
			pageIndex = PageIndex.getPageIndex(Pageing.PAGINATION_SIZE, 1, 0);
		}
		request.setAttribute("pageIndex", pageIndex);		
	}	
}
