日期:2014-05-18  浏览次数:20629 次

displaytag问题,两页以上出问题
单页没有问题,有两页以上时,点击后面几页就抱异常,以下是异常:
exception  

org.apache.jasper.JasperException:   fromIndex   =   -2
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:476)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:389)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)


root   cause  

java.lang.IndexOutOfBoundsException:   fromIndex   =   -2
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.news.newlook_jsp._jspService(newlook_jsp.java:165)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:328)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

下面是我的displaytag:
  <display:table   id= "test "   name= "al "   pagesize= "2 "     >
    <display:column   property= "id ">   </display:column>
    <display:column   property= "title ">   </display:column>
   
    <display:column   property= "content ">   </display:column>
    <display:column   property= "newsDate ">   </display:column>
    <display:column   property= "jpgPath ">   </display:column>
    <display:column   property= "author ">   </display:column>
    <display:column   title= "操作 "> <html:link   page= "/updateinput.do?id=${test.id} "> 修改 </html:link> </display:column>
   
    </display:table>


------解决方案--------------------
你的行对象是什么类型?