繁体   English   中英

DisplayTag服务器端分页

[英]DisplayTag Server-Side Paging

¿如何使用DisplayTag(和Spring MVC)对服务器端进行分页?

我的控制器代码是这样的:

@RequestMapping("/cuenta/refreshCombos.do")
public ModelAndView refreshCombos(HttpServletRequest request, HttpSession session,
        @RequestParam(required= false, value="todas") Boolean todas,
        @RequestParam("idBanco") Long idBanco) throws ParseException{
    Map<String, Object> resul = new HashMap<String, Object>();
    @SuppressWarnings("rawtypes")
    Map paramMap = WebUtils.getParametersStartingWith(request, "d-");

        if (paramMap.size() == 0) {
           if (idBanco == 0){
              cuentaList = obtenerCuentas(0L, true);
           }

           if (idBanco != 0){
              cuentaList = obtenerCuentas(idBanco, false);
           }
        }
    WebUtils.setSessionAttribute(request, "cuentaList", cuentaList);
    resul.put("cuentas", cuentaList);
    return forward("/cuenta/informeCuentas", resul);
}

还有我在JSP中的DisplayTag,如下所示:

<display:table class="displayTags_wrapper" uid="cuenta" name="sessionScope.cuentaList" pagesize='50' defaultsort="1" defaultorder="ascending" requestURI="">  
    <display:column property="becado" sortable="true" title="Becado" maxLength="25" />  
    <display:column property="apellido" sortable="true" title="Titular Cuenta" maxLength="25" />  
    <display:column property="nroCuil" sortable="true" title="CUIL" maxLength="22" />  
    <display:column property="apellidoRR" sortable="true" headerClass="sortable" title="RR" maxLength="25" />
    <display:setProperty name="basic.empty.showtable" value="true" />  
    <display:setProperty name="paging.banner.group_size" value="35" />  
    <display:setProperty name="paging.banner.item_name" value="cuenta" />  
    <display:setProperty name="paging.banner.item_names" value="cuentas" />  
    <display:setProperty name="paging.banner.onepage" value=" " />
</display:table>

这样,我的传呼机就可以正常工作了,但是在客户端...

对服务器端分页有任何帮助或修改吗?

问候,

CaktusJP。

参见http://www.displaytag.org/1.2/tut_externalSortAndPage.html 这个想法是将org.displaytag.pagination.PaginatedList的实例org.displaytag.pagination.PaginatedList给标记,而不是java.util.List

如果是这种情况,则标记将生成带有未编码参数的hrefs,以供加载页码,使用的排序标准和方向(asc,desc)以及可选的搜索ID(例如,用于缓存查询)结果在服务器端。

在这种情况下,您有责任阅读这些参数,并执行查询以允许创建PaginatedList实例。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM