java.lang.NullPointerException请问这是什么错误?为什么会出现这样的错误?多谢了(没分了)
lci21 2001-06-12 09:55:00 我的jsp测试文件:1.jsp
<%@page contentType="text/html;GB2312"%>
<%@page import="content.test"%>
<html>
<body>
<%test.hi();%>
</body>
</html>
运行是浏览器窗口中什么输出都没有!
请问这是为什么呢?tomcat窗口中出现java.lang.NullPointerException
我用的是tomcat1.3
我已经在当前应用中的web-inf下的classes先创建文件夹content,并在content下建立
test.java文件
test.java的内容如下:
package content;
import javax.servlet.jsp.*;
public final class test
{
static JspWriter out = null;
public void setOut(JspWriter out)
{
this.out = out;
}
public static void hi()
{
try
{
out.println("hi");
}
catch(Exception e){System.out.println(e);}
}
}
希望诸位不吝赐教,多谢了