此回复为自动发出,仅用于显示而已,并无任何其他特殊作用
楼主【xusong1988520】截止到2008-07-07 22:42:24的历史汇总数据(不包括此帖):
发帖的总数量:2                        发帖的总分数:130                      
结贴的总数量:1                        结贴的总分数:100                      
无满意结贴数:0                        无满意结贴分:0                        
未结的帖子数:1                        未结的总分数:30                       
结贴的百分比:50.00 %               结分的百分比:76.92 %                  
无满意结贴率:0.00  %               无满意结分率:0.00  %                  
楼主加油

解决方案 »

  1.   

    你自己 的for 语句这里控制一下不久可以了。
    不过每次读取很大的文档,并不是一个好的方法。
      

  2.   

    参考下面代码<html>
    <head>
    <xml id="myCustomer" src="customers.xml"/>
    </head>
    <body>
    <table id="datatable" datapagesize="2" datasrc="#myCustomer" border="1" align="center" width="750">
    <caption>我的客户</caption>
    <thead>
    <th>姓名</th>
    <th>性别</th>
    <th>地址</th>
    <th>电子邮件</th>

    </thead>
    <tr>
    <td><span datafld="姓名"/></td>
    <td><span datafld="性别"/></td>
    <td><span datafld="地址"/></td>
    <td><span datafld="电子邮件"/></td>
    </tr>
    </table>

    <table align="center">
    <tr>
    <td><input type="button" value="第一页" onClick="document.all.datatable.firstPage()"></td>
    <td><input type="button" value="上一页" onClick="document.all.datatable.previousPage()"></td>
    <td><input type="button" value="下一页" onClick="document.all.datatable.nextPage()"></td>
    <td><input type="button" value="最后一页" onClick="document.all.datatable.lastPage()"></td>
    <tr>
    </table>
    </body>
    </html>customers.xml内容
    <?xml version="1.0" encoding="GB2312"?>
    <地址簿>
    <客户 性别="男">
    <姓名>吴梦达</姓名>
    <地址>斧头帮路47号201室</地址>
    <电子邮件>[email protected]</电子邮件>
    </客户>
    <客户 性别="女">
    <姓名>白晶晶</姓名>
    <地址>盘丝洞33号C座</地址>
    <电子邮件>[email protected]</电子邮件>
    </客户>
    <客户 性别="男">
    <姓名>牛魔王</姓名>
    <地址>火焰山北路74号第3茅草屋</地址>
    <电子邮件>[email protected]</电子邮件>
    </客户>
    </地址簿>
      

  3.   

    同意二楼的  在for里,自己控制一下读的参数index.
      

  4.   

    能具体的说明在FOR里面怎么控制马???谢谢越具体越好,再次感谢
      

  5.   


    <%String index = Request.getParameter("PageIndex");//读取pageIndex参数
    int pageIndex = (index==null || index=="")?1:Integer.parse(index);//如果读取到PageIndex参数,则用PageIndex参数中的值作为初始值,否则用1做初始值,这句可能出现异常
    if(pageIndex<=0)
        pageIndex = 1;
    int pageSize = 10;//每页显示10条记录
    int pageCount=(books.getLength()%pageSize==0)?books.getLength()/pageSize:books.getLength()/pageSize+1;//计算页数for (int i=(pageIndex-1)*pageSize;i <=books.getLength() && i<=pageIndex*pageSize ;i++){ //显示当前页的记录
    Element book=(Element) books.item(i-1); 
    out.println(resourceitem.getElementsByTagName("kind").item(0).getFirstChild().getNodeValue()); 
    }for(int i=1;i<=pageCount;i++)
    {
    out.print("<a href=");
    out.print(url);//url=页面url?PageIndex=值(这里直接用i中的值就行了)
    out.print(">");
    out.print(i);
    out.println("</a>");
    }
    %> 
      

  6.   

    String index = Request.getParameter("PageIndex");//读取pageIndex参数
     这句是什么意思呢??Request下游错误 Request cannot be resolved
    int pageIndex = (index==null || index=="")?1:Integer.parse(index);//parse下有错误
    The method parse(String) is undefined for the type Integer呵呵还请再次说明  ,谢谢阿非常的感谢
      

  7.   

    抱歉,写错了Request在jsp里面是小写的,不过楼主不至于这个也看不出来吧.....汗
    Integer.parseInt();
      

  8.   

    这个异常怎么处理呢??我用你的分业没机制实现后 ,当在浏览器中查看时,有时不正常 /怎么会这样呢?希望详细解答!!exception org.apache.jasper.JasperException: /DOMRead.jsp(11,5) Invalid standard action
    org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40)
    org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)
    org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:88)
    org.apache.jasper.compiler.Parser.parseStandardAction(Parser.java:1259)
    org.apache.jasper.compiler.Parser.parseElements(Parser.java:1577)
    org.apache.jasper.compiler.Parser.parse(Parser.java:127)
    org.apache.jasper.compiler.ParserController.doParse(ParserController.java:212)
    org.apache.jasper.compiler.ParserController.parse(ParserController.java:101)
    org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:156)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:296)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:277)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:265)
    org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:564)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:302)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
      

  9.   

    楼主的这个异常是出现在DOMRead.jsp中的,跟Dom.jsp没关系啊
      

  10.   

    另外jsp中的异常很难调试
    建议楼主把逻辑代码写在servlet中,然后通过jstl在前台做显示