当前位置: 代码迷 >> Java Web开发 >> 高手帮忙啊明天交作业!该如何处理
  详细解决方案

高手帮忙啊明天交作业!该如何处理

热度:58   发布时间:2016-04-17 11:06:30.0
高手帮忙啊!!!急急急啊!!!明天交作业!!!!
这是代码:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<%@ page contentType="text/html; charset=gb2312"%>
<%@ page language="java" import="java.sql.*,mypackage.*"%>
<jsp:useBean id="SqlBean" scope="session" class="mypackage.SQLServerConnBean"/>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>2列左侧固定右侧自适应宽度+头部+尾部——<a href="http://www.aa25.cn">标准之路www.aa25.cn</a></title>
<link href="layout.css" rel="stylesheet" type="text/css" />
<meta name="Keywords" content="标准之路,www.aa25.cn,网页标准布局,DIV+CSS" />
<meta name="" content="标准之路,www.aa25.cn,网页标准布局,DIV+CSS" />
<meta name="author" content"×××,有问题请到www.68css.cn网站留言" />
<meta name="Description" content="本套网页标准布局模板是由标准之路(www.aa25.cn)制作完成,如果您要转载,请保留版权" />
</head>

<body>
<div id="container">
  <div id="header">
  <div align="center">
  <table width="453" height="92" border="0">
  <tr>
  <td width="447">政法学院成绩查询</td>
  </tr>
  </table>
  </div>
  </div>
  <div id="mainContent">
  <div id="sidebar">
  <table width="200" height="211" border="0">
  <tr>
  <td>
<p>&nbsp;</p>
  <p>
  <%  
  String id=request.getParameter("textfield");
String pw =request.getParameter("textfield2");
String sf=request.getParameter("radiobutton");
if("t".equals(sf))
{
String sql = "select * from teacher where teano='"+id+"' and pwt='"+pw+"'";
SqlBean.OpenConn();
  ResultSet rs=SqlBean.executeQuery(sql);
  //如果记录集非空,表明有匹配的用户名和密码,登陆成功
  if ( rs.next())
 
  {
session.setAttribute("id",id);
response.sendRedirect("teacher.jsp");
}
  else
{
response.sendRedirect("/loginwrong.jsp");
}
  }
 else
{
String sql1 = "select * from student where sno='" + id + "' and pw= '" + pw + "'"; 
SqlBean.OpenConn();
ResultSet rs=SqlBean.executeQuery(sql1);
if ( rs.next ( ) )
{
session.setAttribute("id",id);
response.sendRedirect("stu/students.jsp");
}
 else
{
response.sendRedirect("/loginwrong.jsp");
}
  }
%>
</body>
</html>
这是错误报告:
description The server encountered an internal error () that prevented it from fulfilling this request.

exception 

org.apache.jasper.JasperException: An exception occurred processing JSP page /check.jsp at line 62

59: String sql1 = "select * from student where sno='" + id + "' and pw= '" + pw + "'"; 
60: SqlBean.OpenConn();
61: ResultSet rs=SqlBean.executeQuery(sql1);
  相关解决方案