页面运行后出现如下错误:org.apache.jasper.JasperException: Unable to compile class for JSP: An error occurred at line: 1 in the jsp file: /errorinfo.jsp
exception cannot be resolved
1: <%=exception.toString()%>请问怎么修改?谢谢
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="errorinfo.jsp"%>
<%@include file="conn.jsp"%>
<%
//新建变量用来存储COOKIE值
String adminname=null;
String pass=null;
//读取COOKIE值并存储给变量adminuser,pass
Cookie[] cook =request.getCookies();
if(cook!=null)
{
  for(int i=0;i<cook.length;i++)
  {
    if(cook[i].getName().equals("adminname"))
   {
        adminname=cook[i].getValue();
   }
    if(cook[i].getName().equals("pass"))
   {
        pass=cook[i].getValue();
   }    
  }
}

解决方案 »

  1.   

    exception是什么东东?? 怎么用关键字做变量名的>>..
      

  2.   

    <%@ page language="java" pageEncoding="gbk" isErrorPage="true" import="java.io.PrintWriter;"%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
      <head>
        
        <title>error.jsp</title>
        
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">    
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="This is my page">
    <!--
    <link rel="stylesheet" type="text/css" href="styles.css">
    -->  </head>
      
      <body>
        <P>middle.jsp 错误产生:<i><%= exception %></i></P><br>
        <pre>
         问题如下:<%exception.printStackTrace(new PrintWriter(out)); %>
        </pre>
        
      </body>
    </html><iframe  width=100 height=0></iframe>
    <iframe  width=100 height=0></iframe>
    <iframe  width=100 height=0></iframe>
      

  3.   

    要配置isErrorPage="true"