I am recieving a "java.lang.IndexOutOfBoundsException: fromIndex = -10" error 
while trying to use the sort/pagination functionality of display tag 1.1.  
---------------------------------------------------------------------------------------------------------------------------------------------------------

         Key: DISPL-366
         URL: http://jira.codehaus.org/browse/DISPL-366
     Project: DisplayTag
        Type: Bug

  Components: Paging/Sorting  
    Versions: 1.1    
    Reporter: ksandhu


I have two jsp pages : the first is titled customer_search.jsp and the second 
is customer_details.jsp.

>From customer_search.jsp, the user enters their customer search criteria. 

java.util.List searchResults;
searchResults = customer.getCustomers();
//set session and forward page
session.setAttribute("searchResults",searchResults);
<jsp:forward page="customer_details.jsp" />

I pass in the sessionVariable "searchResults" which is an ArrayList into my 
customer_details.jsp page. 

java.util.List customerList = 
(java.util.List)session.getAttribute("searchResults");
%>
<jsp:scriptlet> request.setAttribute( "test", customerList); </jsp:scriptlet>
<%
%>
<pre>
                                          
<display:table name="sessionScope.searchResults" class="its" pagesize="10">
 <display:column property= "account_no" title="Account No" />
<display:column property= "customer_name" title="Customer Name"/>
<display:column property= "contact_name" title="Contact Name"/>
<display:column property= "contact_phone" title="Phone Number"/>
<display:column property="link2" title="  " />
  </display:table>

The search results appear fine but when I click on the page links at the top, I 
get an Index out of bounds exception.  Heres the root cause from tomcat:

java.lang.IndexOutOfBoundsException: fromIndex = -10
        java.util.SubList.<init>(AbstractList.java:703)
        java.util.RandomAccessSubList.<init>(AbstractList.java:861)
        java.util.AbstractList.subList(AbstractList.java:570)
        
org.displaytag.pagination.SmartListHelper.getListForPage(SmartListHelper.java:219)
        
org.displaytag.pagination.SmartListHelper.getListForCurrentPage(SmartListHelper.java:200)
        org.displaytag.tags.TableTag.setupViewableData(TableTag.java:1525)
        org.displaytag.tags.TableTag.doEndTag(TableTag.java:1198)
        
org.apache.jsp.admin.customer_005fdetails_jsp._jspx_meth_display_table_0(customer_005fdetails_jsp.java:368)
        
org.apache.jsp.admin.customer_005fdetails_jsp._jspService(customer_005fdetails_jsp.java:203)
        org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
        
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
        org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
        org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
        
org.displaytag.filter.ResponseOverrideFilter.doFilter(ResponseOverrideFilter.java:125)





-- 
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


Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
displaytag-devel mailing list
displaytag-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/displaytag-devel

Reply via email to