<%@ page autoFlush = "false" buffer = "1kb" errorPage = "error.html"%>
换成下面这个
<%@ page contentType="text/html; charset=GB2312" language="java" %>

解决方案 »

  1.   

    应该是classpath中设置的问题吧,我把这个jsp文件放到tomcat\webapps\root目录下进行访问就没有问题
      

  2.   

    我完整贴一下我的配置:
    server.xml
    加入了
           <Context path="/myjsp" 
                    docBase="D:\Jspcode" 
                    crossContext="false"
                    debug="0" 
                    reloadable="true" > 
           </Context>AutoFlush.jsp
    <%@ page contentType="text/html; charset=GB2312" language="java" %>
    <html>
    <head>
    <title>AutoFlush Example</title>
    </head>
    <body>
    <h1>AutoFlush Example Make a Try</h1>
    <a href = "AutoFlush.jsp?loop=5">Print loop=5(won't overflow)<br></a>
    <a href = "AutoFlush.jsp?loop=15">Print loop=15(won't overflow)<br></a>
    <a href = "AutoFlush.jsp?loop=30">Print loop=30(will overflow)<br></a><%
    String loops=request.getParameter("loop");
    int loop_times = 5;
    if (loops!=null)
    loop_times=Integer.parseInt(loops);
    for(int i=0;i<loop_times;i++)
    out.print(i+"***************************************<br>");
    %>
    </body>
    </html>
    然后http://localhost:8080/myjsp/AutoFlush.jsp
    报错:
    type Exception reportmessage description The server encountered an internal error () that prevented it from fulfilling this request.exception org.apache.jasper.JasperException: Unable to compile class for JSP