一个怪现象,大家来看看~
在编写关于“Response”的代码时,遇到这样的怪事。
直接通过Tomcat运行范例程序时,报错:
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 org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:372)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
root cause
java.lang.NullPointerException java.util.Arrays$ArrayList. <init> (Unknown Source)
java.util.Arrays.asList(Unknown Source)
org.apache.jsp.ch4.resposne_jsp._jspService(resposne_jsp.java:50)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
note The full stack trace of the root cause is available in the Apache Tomcat/5.0.28 logs.
可是在运行过之前写的一个“Request.jsp”以后再运行就完全没有问题了。
但是在“Firefox”中无论如何运行都报错。
而且在NetBeans5.5中这个jsp根本无法通过编译。可是这是范例程序啊,为什么呢?似乎运行时出的问题和在NetBeans中出的问题原因是不一样的。NetBeans中编译时显示:
init:
deps-module-jar:
deps-ear-jar:
deps-jar:
library-inclusion-in-archive:
library-inclusion-in-manifest:
compile:
compile-jsps:
Compiling 1 source file to C:\Documents and Settings\Java\Response\build\generated\classes
C:\Documents and Settings\Java\Response\build\generated\src\org\apache\jsp\response_jsp.java:65: 警告:编码 GBK 的不可映射字符
out.println( "涓婁竴娆¤闂殑鏃堕棿锛?+cookie_response.getValue());
^
C:\Documents and Settings\Java\Response\build\generated\src\org\apache\jsp\response_jsp.java:65: 未结束的字符串字面值
out.println( "涓婁竴娆¤闂殑鏃堕棿锛?+cookie_response.getValue());
^
C:\Documents and Settings\Java\Response\build\generated\src\org\apache\jsp\response_jsp.java:66: 需要 ') '
cookie_response.setValue(new Date().toString());
&nb