curpage=(int)Integer.parseInt(request.getParameter("gotopage"));request.getParameter("gotopage");可能为空你这错误是某个地方产生空了

解决方案 »

  1.   

    空指针异常,,看看你哪出现了null数据对象
      

  2.   

    last page      <A:href="page.jsp?gotopage=<%=(curpage-1)%>"></A>
    next page      <A:href="page.jsp?gotopage=<%=(curpage+1)%>"></A>
      

  3.   

    我照着楼上各位改了两处:
    一:
     String midString=request.getParameter("gotopage");
      if(midString==null){ 
      curpage=1;
      }
     else{
      curpage=new Integer(midString).intValue();
      }
    二:
    <%if(curpage>1){%> 
    last page <A:href="page.jsp?curpage=<%=(curpage-1)%>"></A>
    <%
    }
    %>
    <%if(curpage<allpage){%>
    next page<A:href="page.jsp?curpage=<%=(curpage+1)%>"></A>
    <%
    }
    %>
    结果还是一样的错误
      

  4.   

    String sql="select count(ProductsID) as A from products;";
    sql语句里面不需要分号
      

  5.   

    对SQL后面没分号,
    顺便看下你的数据库连接对没有。看别人的代码还是头痛
      

  6.   

    String sql="select count(ProductsID) as A from products";
    是取行数吧?那你ResultSet rs1=stmt.executeQuery(sql); 去得rs1后
    while(rs1.next()){
        int ProductID=rs1.getInt("ProductID");
        String ProductName=rs1.getString("ProductName");
        int SupplierID=rs1.getInt("SupplierID");
        int CategoryID=rs1.getInt(" CategoryID");
    }
    %>除了ProductID其他你怎么可能得到呢?
    改成这样试试String sql="select count(*) as A from products";