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

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

public class HelloWorldServlet extends GenericServlet
String initString;

public void init(ServletConfig config)
throws ServletException
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");
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
2000-11-10 -04:00
This post has been archived. It cannot be replied.
Page address has been copied. To share, click to copy page address.
Share Online by QR Code

Back To Topic: hi,Japper, what's about error 500?

Back To Forum: HOME枫下论坛枫下论坛主坛工作学习IT技术讨论