Question

alwaysgreen (alwaysgreen)
本文发表在 rolia.net/zh 相约加拿大网上社区枫下论坛
I create a servlet program named
HelloWorldServlet.java

import java.io.*;
import java.util.Date;
import javax.servlet.*;

public class HelloWorldServlet extends GenericServlet
{
String initString;

public void init(ServletConfig config)
throws ServletException
{
super.init(config);
initString=new String("I have been initialized");
}
public void Service(ServletRequest req,ServletResponse res)
throws IOException, ServletException
{
Date today=new Date();
ServletOutputStream out=res.getOutputStream();
out.println("Hello World");
out.println(today.toString());
out.println(getServletInfo());
}
public void Destroy()
{

}
public String getServletInfo()
{
return "Create a page that says Hello World and send date back produced by djf";
}
}

When I compile it ,it shows me "Class HelloWorldSerlet must be declared abstrat.It dose not define void service...."
It seems that I didn't success declare the class HelloWorldServlet at first.
I just want to test the method of GenericServlet.
So please tell why I got that error.
更多精彩文章及讨论,请光临枫下论坛. 网址: rolia.net/zh
(#13939@0)
2000-11-10 -05:00

回到话题: hi,Japper, what's about error 500?

回到论坛: HOME枫下论坛枫下论坛主坛工作学习IT技术讨论

URL:   
http://www.rolia.net/zh/post.php?f=0&p=13939