HTTP Status 500 错误HTTP Status 500 - --------------------------------------------------------------------------------type Exception reportmessage description The server encountered an internal error () that prevented it from fulfilling this reques
来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/28 11:01:52
HTTP Status 500 错误HTTP Status 500 - --------------------------------------------------------------------------------type Exception reportmessage description The server encountered an internal error () that prevented it from fulfilling this reques
HTTP Status 500 错误
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:Unable to compile class for JSP:
An error occurred at line:18 in the jsp file:/test_jsp.jsp
Cannot invoke write(String) on the primitive type void
15:}
16:Date now1=new Date();
17:out.println("执行后时间:"+DateFormat.getTimeInstance().format(now1)+"
");
18:out.println("程序总共循环了:"+count+"次
");
19:%>
20:
21:
An error occurred at line:18 in the jsp file:/test_jsp.jsp
Syntax error on tokens,delete these tokens
15:}
16:Date now1=new Date();
17:out.println("执行后时间:"+DateFormat.getTimeInstance().format(now1)+"
");
18:out.println("程序总共循环了:"+count+"次
");
19:%>
20:
21:
Stacktrace:
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:92)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330)
org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:423)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:317)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:295)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:282)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:586)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
note The full stack trace of the root cause is available in the Apache Tomcat/6.0.18 logs.
--------------------------------------------------------------------------------
Apache Tomcat/6.0.18
以下是源代码;
测试JSP运行时间
HTTP Status 500 错误HTTP Status 500 - --------------------------------------------------------------------------------type Exception reportmessage description The server encountered an internal error () that prevented it from fulfilling this reques
你太不小心了, 有两个错误:
1.你没有设置编码,你的页面里有中文,而默认的ISO-8859-1并不符合.所以你应该在第一行加入一句
2.你的程序:out.println("程序总共循环了:"+count+"次
");
最后一个分号看见了吗?你改成英文符号的";",而不能用中文的";".