早教吧作业答案频道 -->其他-->
HTTPStatus500错误HTTPStatus500---------------------------------------------------------------------------------typeExceptionreportmessagedescriptionTheserverencounteredaninternalerror()thatpreventeditfromfulfillingthisreques
题目详情
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 -
--------------------------------------------------------------------------------
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运行时间
▼优质解答
答案和解析
你太不小心了, 有两个错误:
1.你没有设置编码,你的页面里有中文,而默认的ISO-8859-1并不符合.所以你应该在第一行加入一句
2.你的程序:out.println("程序总共循环了:"+count+"次
");
最后一个分号看见了吗?你改成英文符号的";",而不能用中文的";".
1.你没有设置编码,你的页面里有中文,而默认的ISO-8859-1并不符合.所以你应该在第一行加入一句
2.你的程序:out.println("程序总共循环了:"+count+"次
");
最后一个分号看见了吗?你改成英文符号的";",而不能用中文的";".
看了 HTTPStatus500错...的网友还看了以下:
二元函数积分的应用题一个气球的体积被定义为V=(e^-h)/(1+t^2),h(t)>0表示在t时 2020-06-03 …
一颗球被扔上空,原始速度为18m/s,h(t)=高度在t=秒数,1.8是球被扔上空的高度h(t)= 2020-06-07 …
MATLAB求解Black-Sholes方程,假设:S=1;T=0.25;rf=0.1;K=1;如 2020-06-14 …
已知三个热化学方程式:(1)I2(g)+H2(g)2HI(g)ΔH=-9.48kJ·mol-1(2 2020-07-19 …
为什么t’等于1/2t1时,甲的面积比乙的面积多3/4S甲乙两车在公路上沿同一方向做直线运动,它们 2020-07-30 …
这个程序运行减法的时候有错误.如果我从键盘输入一个负数就会出错.急#include#include# 2020-11-01 …
若函数f(x)在[0,1]上满足:对于任意的s,t∈[0,1],λ>0,都有f(s)+λf(t)1+ 2020-11-19 …
一个位移和加速度的问题s=v.t+0.5at平方当加速度a为负数时比如-2吧s=v.t-t平方那随着 2020-11-24 …
一列简谐横波正在沿x轴的正方向传播,波速为0.5m/s,t=0时刻的波形如图甲所示.(1)求横波中质 2020-12-09 …
波源S在t=0时刻从平衡位置开始向上运动,形成向左右两侧传播的简谐横波.S、a、b、c、d、e和a′ 2020-12-15 …