<%@ page language="Java"
import="Java.util.Date"
contentType="text/html;charset=gb2312"
session="true"
buffer="24"
autoFlush="false"
errorPage="ErrorPage.jsp"
isErrorPage="false"
isThreadSafe="ture"
info="page编译指令范例页面"
%>
<html>
<body>
<%
out.println("页面信息:"+getServletInfo()+"<br>");
//for(int i=0;i<=100000;i++)
//{
//out.println(i+"<br>");
//}
%>
<%
if(session.getAttribute("bk")==null)
session.serAttribute("bk","JSP");
else
session.setAttribute("bk",session.getAttribute("bk")+"book");
string inform=(String)session.getAttribute("bk");
out.println("此书为"+inform+"<br>");
Date date=new Date();
int year=1900+date.getYear();
int month=1+date.getMonth();
int day=date.getDate();
out.println("今天是"+year+"年"+month+"月"+day+"日");
%>
</body>
</html>
刚学jsp,在书上抄了这个程序,怎么不能运行啊。
HTTP Status 500 -
--------------------------------------------------------------------------------
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: /diy/page_directive.jsp(1,1) Page directive: invalid value for buffer
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:102)
org.apache.jasper.compiler.PageInfo.setBufferValue(PageInfo.java:456)
org.apache.jasper.compiler.Validator$DirectiveVisitor.visit(Validator.java:145)
org.apache.jasper.compiler.Node$PageDirective.accept(Node.java:590)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2336)
org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2386)
org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2392)
org.apache.jasper.compiler.Node$Root.accept(Node.java:489)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2336)
org.apache.jasper.compiler.Validator.validate(Validator.java:1700)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:178)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:306)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:286)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:273)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:566)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:308)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
note The full stack trace of the root cause is available in the Apache Tomcat/6.0.10 logs.
--------------------------------------------------------------------------------
Apache Tomcat/6.0.10
出现上面的错误,请达人给看看哈