HTTP Status 500 - --------------------------------------------------------------------------------type Exception reportmessage description The server encountered an internal error () that prevented it from fulfilling this request.exception org.apache.jasper.JasperException: Unable to compile class for JSP: An error occurred at line: 24 in the jsp file: /cxtj/xsxxquest.jsp
Duplicate local variable strCount
21:    qu.setAndor(andor); qu.setSdate(sdate); qu.setEdate(edate);
22:    String strCount=qu.getCount(table);
23:    //调用Bean中getDateCount()方法来获得在用户调教的时间段里查询到的记录总数
24:    String strCount=qu.getDateCount(table,date);
25:    if(pages==null||pages.equals("null")){
26:      pages="0";
27:    }
An error occurred at line: 24 in the jsp file: /cxtj/xsxxquest.jsp
The method getDateCount(String) in the type QuestString is not applicable for the arguments (String, String)
21:    qu.setAndor(andor); qu.setSdate(sdate); qu.setEdate(edate);
22:    String strCount=qu.getCount(table);
23:    //调用Bean中getDateCount()方法来获得在用户调教的时间段里查询到的记录总数
24:    String strCount=qu.getDateCount(table,date);
25:    if(pages==null||pages.equals("null")){
26:      pages="0";
27:    }
An error occurred at line: 30 in the jsp file: /cxtj/xsxxquest.jsp
The method getDateString(String) in the type QuestString is not applicable for the arguments (String, String)
27:    }
28:    qu.setQuerySql(httpFile,pages,strCount);
29:    //用来获得在表tb_sell中在用户提交的时间段里查询到的记录的结果集
30:    ResultSet rs=rst.getResult((String)qu.getDateString(table,date));
31:    int i=0,Page=qu.getCurPage(),pagesize=qu.getPageSize();
32:    while(rs.next()){
33:      if(i>(Page-1)*pagesize-1){
Stacktrace:
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:93)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330)
org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:435)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:298)
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)
note The full stack trace of the root cause is available in the Apache Tomcat/5.5.26 logs.
--------------------------------------------------------------------------------Apache Tomcat/5.5.26
代码:<%@ page contentType="text/html;charset=gb2312" language="java"%>
<%@ page import="java.io.*,java.sql.*"%>
<jsp:useBean id="rst" scope="page" class="com.mingri.dbconn.DBResult"/>
<jsp:useBean id="qu" scope="page" class="com.mingri.info.QuestString"/>
<jsp:useBean id="trans" scope="page" class="com.mingri.chinese.ToChinese"/>
<html>
  <title>查询</title>
  <link href="../CSS/style.css" rel="stylesheet" type="text/css">
<body bgcolor="#F2F2F2">
<%
   String table="tb_sell",httpFile="xsxxquest.jsp";
   String date="xsdate";
   String pages=request.getParameter("pages");
   String cif=request.getParameter("cif");
   String ccif=request.getParameter("ccif");
   String qvalue=trans.trans(request.getParameter("qvalue"));
   String andor=request.getParameter("andor");
   String sdate=request.getParameter("sdate");//获得表单中查询起始时间
   String edate=request.getParameter("edate");//获得表单中查询截止时间
   qu.setCcif(ccif);qu.setCif(cif);qu.setQValue(qvalue);
   qu.setAndor(andor); qu.setSdate(sdate); qu.setEdate(edate);
   String strCount=qu.getCount(table);
   //调用Bean中getDateCount()方法来获得在用户调教的时间段里查询到的记录总数
   String strCount=qu.getDateCount(table,date);
   if(pages==null||pages.equals("null")){
     pages="0";
   }
   qu.setQuerySql(httpFile,pages,strCount);
   //用来获得在表tb_sell中在用户提交的时间段里查询到的记录的结果集
   ResultSet rs=rst.getResult((String)qu.getDateString(table,date));
   int i=0,Page=qu.getCurPage(),pagesize=qu.getPageSize();
   while(rs.next()){
     if(i>(Page-1)*pagesize-1){
%><table width="500" height="140" border="1" align="center" cellpadding="-1" cellspacing="0">
  <tr bgcolor="#DDDDDD">
    <td width="202" height="27" bgcolor="#FFFFC1"><font color="#336699">销售票号:
      <%=rs.getString("ID")%></font></td>
    <td width="202" bgcolor="#FFFFC1"><font color="#336699">药品编号:
      <%=rs.getString("spid")%></font></td>
    <td width="202" bgcolor="#FFFFC1"><font color="#336699">药品名称:
      <%=rs.getString("spname")%></font></td>
  </tr>
  <tr bgcolor="#DDDDDD">
    <td width="195" height="27" bgcolor="#FFFFC1"><font color="#336699">简称:
      <%=rs.getString("jc")%></font></td>
    <td width="202" bgcolor="#FFFFC1"><font color="#336699">产地:
      <%=rs.getString("cd")%></font></td>
    <td width="202" bgcolor="#FFFFC1"><font color="#336699">规格:
      <%=rs.getString("gg")%></font></td>
  </tr>
  <tr bgcolor="#DDDDDD">
    <td width="202" height="29" bgcolor="#FFFFC1"><font color="#336699">包装:
      <%=rs.getString("bz")%></font></td>
    <td width="202" bgcolor="#FFFFC1"><font color="#336699">单价:
      <%=rs.getString("dj")%></font></td>
    <td width="202" bgcolor="#FFFFC1"><font color="#336699">数量:
      <%=rs.getString("sl")%></font></td>
  </tr>
  <tr bgcolor="#DDDDDD">
    <td width="202" height="26" bgcolor="#FFFFC1"><font color="#336699">金额:
      <%=rs.getString("je")%></font></td>
    <td width="202" bgcolor="#FFFFC1"><font color="#336699">客户全称:
      <%=rs.getString("khname")%></font></td>
    <td width="202" bgcolor="#FFFFC1"><font color="#336699">销售日期:
      <%=rs.getString("xsdate").substring(0,10)%></font></td>
  </tr>
  <tr bgcolor="#DDDDDD">
    <td width="202" bgcolor="#FFFFC1"><font color="#336699">操作员:
      <%=rs.getString("czy")%></font></td>
    <td width="202" bgcolor="#FFFFC1"><font color="#336699">经手人:
      <%=rs.getString("jsr")%></font></td>
    <td width="202" bgcolor="#FFFFC1"><font color="#336699">结算方式:
      <%=rs.getString("jsfs")%></font></td>
  </tr>
</table><br>
<%}i++;}
rs.close();
String str_parameter="&cif="+qu.getCif()+"&ccif="+qu.getCcif()+"&qvalue="+qu.getQValue()+
                     "&andor="+qu.getAndor()+"&sdate="+qu.getSdate()+"&edate="+qu.getEdate();
qu.setStr_parameter(str_parameter);
%>
<%=qu.pageFooter()%>
</form>
</table>
</body>
</html>