帮我看看,哪里少了;号,送分50 ( 积分: 50 )

  • 主题发起人 主题发起人 阿bao
  • 开始时间 开始时间

阿bao

Unregistered / Unconfirmed
GUEST, unregistred user!
<%@ page contentType=&quot;text/html;
charset=gb2312&quot;
language=&quot;java&quot;
import=&quot;java.sql.*,java.util.*&quot;%>
<!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01 Transitional//EN&quot;
&quot;http://www.w3.org/TR/html4/loose.dtd&quot;>
<html>
<head>
<title>登陆验证页面</title>
<jsp:useBean id=&quot;db&quot;
class=&quot;opendb.opendb&quot;/>
<%
String getAadno=new String(request.getParameter(TXT_ADNO));
String getAadpw=new String(request.getParameter(TXT_ADPW));
String sql=&quot;select adno,adpw from adtable where adno='&quot;+getAadno+&quot;' and adpw='&quot;+getAadpw+&quot;'&quot;;
ResultSet rs=db.executeQuery(sql);
if(rs.next())
{
system.out.println(&quot;登陆成功&quot;)
}
else
{
system.out.println(&quot;对不起,您的输入有误,请重新输入&quot;)
}
%>
</head>
<body>
</body>
</html>
调试后出现
org.apache.jasper.JasperException: Unable to compile class for JSP
An error occurred at line: 8 in the jsp file: /website/BgSys/admin_login1.jsp
Generated servlet error:
[javac] Compiling 1 source file
D:/tomcat/work/Standalone/localhost/_/website/BgSys/admin_login1_jsp.java:72: ';' expected
}
^

An error occurred at line: 8 in the jsp file: /website/BgSys/admin_login1.jsp
Generated servlet error:
D:/tomcat/work/Standalone/localhost/_/website/BgSys/admin_login1_jsp.java:76: ';' expected
}
^
2 errors
 
<%@ page contentType=&quot;text/html;
charset=gb2312&quot;
language=&quot;java&quot;
import=&quot;java.sql.*,java.util.*&quot;%>
<!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01 Transitional//EN&quot;
&quot;http://www.w3.org/TR/html4/loose.dtd&quot;>
<html>
<head>
<title>登陆验证页面</title>
<jsp:useBean id=&quot;db&quot;
class=&quot;opendb.opendb&quot;/>
<%
String getAadno=new String(request.getParameter(TXT_ADNO));
String getAadpw=new String(request.getParameter(TXT_ADPW));
String sql=&quot;select adno,adpw from adtable where adno='&quot;+getAadno+&quot;' and adpw='&quot;+getAadpw+&quot;'&quot;;
ResultSet rs=db.executeQuery(sql);
if(rs.next())
{
system.out.println(&quot;登陆成功&quot;)
}
else
{
system.out.println(&quot;对不起,您的输入有误,请重新输入&quot;)
}
%>
</head>
<body>
</body>
</html>
调试后出现
org.apache.jasper.JasperException: Unable to compile class for JSP
An error occurred at line: 8 in the jsp file: /website/BgSys/admin_login1.jsp
Generated servlet error:
[javac] Compiling 1 source file
D:/tomcat/work/Standalone/localhost/_/website/BgSys/admin_login1_jsp.java:72: ';' expected
}
^

An error occurred at line: 8 in the jsp file: /website/BgSys/admin_login1.jsp
Generated servlet error:
D:/tomcat/work/Standalone/localhost/_/website/BgSys/admin_login1_jsp.java:76: ';' expected
}
^
2 errors
 
提示都告诉你了
admin_login1.jsp页面中有错误
错误写在admin_login1_jsp.java文件的第76行,在这有详细描述
 
呵呵,让DFW们练眼呢?
根据错误提示信息更改呗:)
 
if(rs.next())
{
system.out.println(&quot;登陆成功&quot;) //此处
}
else
{
system.out.println(&quot;对不起,您的输入有误,请重新输入&quot;) //此处
}
 
注意标点符号
 
system.out.println(&quot;登陆成功&quot;)

system.out.println(&quot;对不起,您的输入有误,请重新输入&quot;)
后面都没有写分号, 看来是受Delphi的影响, 哈哈
 
呵呵,错误很明显啊
 
楼上的都说了啊!
 
***又是个白痴
 
这么简单的问题,散分的时候别给我,丢脸。
 
无奈啊,
程序员最重要的就是遇到问题时自己的思考能力,希望你能提些有家值的问题大家一块提高
 
接受答案了.
 
后退
顶部