- 论坛徽章:
- 0
|
<%@ include file="conn.jsp"%>
<%request.setCharacterEncoding("GB2312");
String name=request.getParameter("username");
String pass=request.getParameter("password");
String sql="select * from cdsms_user where username like ' " + name + " ' and password like ' " + pass + " ' ";
ResultSet rs=stmt.executeQuery(sql);
if(!rs.next()){
out.print("<script language='javascript'>");
out.print("alert('账号或密码错误');");
out.print("history.go(-1);");
out.print("</script>");
}else{
rs.close();
session.putValue("pass","ok");
response.sendRedirect("index.jsp");
}
%>
org.apache.jasper.JasperException: Unable to compile class for JSP
An error occurred at line: 2 in the jsp file: /check.jsp
Generated servlet error:
Duplicate local variable rs
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
root cause
org.apache.jasper.JasperException: Unable to compile class for JSP
An error occurred at line: 2 in the jsp file: /check.jsp
Generated servlet error:
Duplicate local variable rs
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:328)
org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:414)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:297)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:276)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:264)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:563)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:303)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
到底哪里出问题了?
[ 本帖最后由 perryhg 于 2006-5-29 17:38 编辑 ] |
|