struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "red phoenix" <rodphoe...@gmail.com>
Subject how to use pager tag in struts2?
Date Tue, 19 Aug 2008 15:36:35 GMT
I want to use Pager Tag Library2.0 in struts2,I set maxPageItems under
struts2.0 action,like follows:

request.setAttribute("maxPageItems","10");
return SUCCESS;

then I use maxPageItems in JSP page,like follows:
<pg:pager
    items="50"
    index="center"
    maxPageItems="${request.maxPageItems}"
    maxIndexPages="10"
    isOffset="<%= true %>"
    export="offset,currentPageNumber=pageNumber"
    scope="request">
    ......
</pg:pager>

When I run above code,it raise error:
22: <%@ include file="/pages/common/common.jsp" %>
23: <%@ taglib uri="http://jsptags.com/tags/navigation/pager" prefix="pg" %>
24:
25:    <pg:pager
26:     items="50"
27:     index="center"
28:     maxPageItems="${request.maxPageItems}"
Stacktrace:
 org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:524)
 org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:435)
 org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
 org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
 javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
 org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:413)

root cause
java.lang.ArithmeticException: / by zero
com.jsptags.navigation.pager.PagerTag.pageNumber(PagerTag.java:334)

I have set the value maxPageItems,why it can't be used with
${request.maxPageItems} in pager tag?
How to use pager tag in struts2? Anybody could give me a example?

Thanks in advance!
Best Regards,
phoenix

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message