[
http://jira.codehaus.org/browse/DISPL-334?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
fabrizio giustina closed DISPL-334.
-----------------------------------
Resolution: Cannot Reproduce
Fix Version/s: (was: 1.1.2)
1.1.1
Unable to reproduce the error on the current trunk, I've added a testcase
(DISPL-334.jsp) and tweaked SmartListHelper so that is should never return
values > 0.
> display:table pagesize="xx" attrinute fail with multiple tables in same JSP
> ----------------------------------------------------------------------------
>
> Key: DISPL-334
> URL: http://jira.codehaus.org/browse/DISPL-334
> Project: DisplayTag
> Issue Type: Bug
> Components: Tag Library
> Affects Versions: 1.1
> Reporter: Knut Erik Ballestad
> Fix For: 1.1.1
>
> Attachments: SmartListHelper.java.patch
>
>
> _display:table name="requestScope.purchaseItems_list" class="tab"
> pagesize="6"_
> I have 2 tables underneath each other in a data mining-like web application.
> The tables resides in different JSP fragment files that are included from a
> main JSP page.
> If the bottom table are sent an empty list, displaytag crashes (but only if
> the pagesize attribute exist in the JSP).
> - if the bottom list contains data, everything is OK
> - if the bottom list JSP doesn't use the pagesize="x" attribute, everything
> is OK
> Example (Bottom list is empty, and pagesize="6"):
> -results in this stack trace:
> 15:16:59,075 ERROR [[jsp]] Servlet.service() for servlet jsp threw exception
> java.lang.IndexOutOfBoundsException: fromIndex = -6
> at java.util.SubList.<init>(AbstractList.java:703)
> at java.util.RandomAccessSubList.<init>(AbstractList.java:861)
> at java.util.AbstractList.subList(AbstractList.java:570)
> at
> org.displaytag.pagination.SmartListHelper.getListForPage(SmartListHelper.java:219)
> at
> org.displaytag.pagination.SmartListHelper.getListForCurrentPage(SmartListHelper.java:200)
> at org.displaytag.tags.TableTag.setupViewableData(TableTag.java:1525)
> at org.displaytag.tags.TableTag.doEndTag(TableTag.java:1198)
> at
> org.apache.jsp.list.PurchaseItems_jsp._jspService(org.apache.jsp.list.PurchaseItems_jsp:696)
> From debugging SmartListHelper:
> line 166:
> return (pageNumber - 1) * this.pageSize;
> line 217-219:
> int firstIndex = getFirstIndexForPage(pageNumber);
> int lastIndex = getLastIndexForPage(pageNumber);
> return this.fullList.subList(firstIndex, lastIndex + 1);
> When line 217 call line 166, and there are no pages (pageNumber=0), the
> returned index is (-1 * 'the defined pagesize from JSP'),
> which results in the stack trace above
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
displaytag-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/displaytag-devel