我用jbuilder来编写JSP页面,以下代码是做一个测试,是利用自己写好的一些类来读取数据库里的数据。
但运行是却出现:"jsp1.jsp": cannot find symbol; symbol  : method sizi(), location: class java.util.ArrayList  的错误。
错误是第一句发生的,请各位帮忙解释一下!
先谢谢各位回帖的前辈们!jsp1.jsp:
<%@ page contentType="text/html; charset=GBK" %>
<%@ page import="java.sql.*"%>
<%@ page import="test1.*" %>
<%@ page import="java.util.*" %>
<html>
<head>
<title>
jsp1
</title>
</head>
<body bgcolor="#ffffff">
<h1>
</h1>
<form method="post" action="jsp1.jsp" name="form1">
  <input type="text" name="jcs"/>
  <br />
  <input type="submit" value="提交"/>
  <br><br></form>
<%! String st=null;
    User us=null;
    DB db=new DB();
    buyrecord record=new buyrecord();
    ArrayList ary=new ArrayList();%><% st=request.getParameter("jcs");
   ary=db.get_emanager_record(st);   for(int i;i<ary.sizi();i++)
   {
     record=(buyrecord)ary.get(i);
     out.print(record.getMeterialid());
   }%>
</body>
</html>

解决方案 »

  1.   

       for(int i;i <ary.sizi();i++) ---->拼写错误  ary.size()
       {
         record=(buyrecord)ary.get(i);
         out.print(record.getMeterialid());
       } 
      

  2.   

    以下该过后,还有两个异常不知道怎么处理?
    "jsp1.jsp": cannot find symbol; symbol  : class IOException, location: class org.apache.jsp.jsp1_jsp
    "jsp1.jsp": cannot find symbol; symbol  : class FileNotFoundException, location: class org.apache.jsp.jsp1_jsp
    我已经catch所有的异常了,又是什么原因还会出现异常呢?<%@ page contentType="text/html; charset=GBK" %>
    <%@ page import="java.sql.*"%>
    <%@ page import="test1.*" %>
    <%@ page import="java.util.*" %>
    <html>
    <head>
    <title>
    jsp1
    </title>
    </head>
    <body bgcolor="#ffffff">
    <h1>
    </h1>
    <form method="post" action="jsp1.jsp" name="form1">
      <input type="text" name="jcs"/>
      <br />
      <input type="submit" value="提交"/>
      <br><br></form>
    <%! String st=null;
        User us=null;
        DB db=new DB();
        buyrecord record=new buyrecord();
        ArrayList ary=new ArrayList();%><% st=request.getParameter("jcs");
    try{
      ary=db.get_emanager_record(st);
      
      for(int i=0;i<ary.size();i++)
      {
        record=(buyrecord)ary.get(i);
        out.print(record.getMeterialid());
      }
    }catch(SQLException ex)
    {
    }catch(ClassNotFoundException ex1)
    {
    }catch(FileNotFoundException ex2)
    {
    }catch(IOException ex3)
    {
    }%>
    </body>
    </html>
      

  3.   

    晕死了,又是在页面里写业务逻辑...
    你该把异常都输出出来,你只是捕获了异常,不输出具体信息,你以为TOMCAT能给你报出详细错误啊?