日期:2014-05-17  浏览次数:20682 次

jsp异常
请高手指教!
jsp老是异常
jsp如下:

<%@ page contentType="text/html; charset=gbk" language="java"%>
<%@ page import="java.sql.*"%>
<%@ page import="java.io.*"%>
<%@ page import="java.util.*"%>
<%@ page import="javabean.*"%>


<%!//每页显示的记录数
  int pageSize = 8;
  int showPage = 1;
%>
<%

  request.setCharacterEncoding("gbk");
  String yuanxi = session.getAttribute("yuanxi").toString();
  String nianji = session.getAttribute("nianji").toString();
  String zhuanye = session.getAttribute("zhuanye").toString();
  String xuenian = session.getAttribute("xuenian").toString();
  String xueqi = session.getAttribute("xueqi").toString();
  String kecheng = session.getAttribute("kecheng").toString();
  Object ob = session.getAttribute("teacher");
  String teacher = ob.toString();
  String strPage = null;
  String hang1 = request.getParameter("hangshu");
  if (hang1 != null) {
  // byte[] b = hang1.getBytes("iso-8859-1");
  // hang1 = new String(b);
  int hang = Integer.parseInt(hang1);
  System.out.println(hang);

  if (hang > 0) {

  System.out.println(hang + "yyh");
%>
<jsp:useBean id="selectCourse" scope="session" class="javabean.SeleCourse"/>
<%
  int[] cundefen = new int[hang];
  String[] cundehao = new String[hang];
  for (int i = 0; i < hang; i++) {
  String ss = request.getParameter("fen" + i);
  System.out.print(ss);
  cundefen[i] = Integer.parseInt(ss);
  cundehao[i] = request.getParameter("hao" + i);
  }
  selectCourse.setGrade(cundefen);
  selectCourse.setCnumber(cundehao);
  int[] j = selectCourse.UpdataGrade(kecheng, xueqi, xuenian);
  System.out.println(j[0] + "aaa");
  }
  }
  strPage = request.getParameter("showPage");
  if (strPage == null) {
  showPage = 1;
  } else {
  try {
  showPage = Integer.parseInt(strPage);

  } catch (NumberFormatException e) {
  showPage = 1;
  }
  if (showPage < 1) {
  showPage = 1;
  }
  }%>
<jsp:useBean id="pages" scope="page" class="javabean.splitPage" />
<%
  pages.initialize(kecheng, xueqi, xuenian, zhuanye, yuanxi, teacher, pageSize, showPage);
  ResultSet rs = pages.getPage();
  rs.last();
  int xianshi = rs.getRow();
  rs.beforeFirst();
%>
<html>
  <head>
  <meta http-equiv="Content-Type" content="text/html; charset=gbk">
  <title>分页显示</title>
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
  <div align=center>
  <form action="chulichengji.jsp" method="post" target="_s