servlet编程(实现servlet接口方法)

作者在 2016-03-02 09:02:18 发布以下内容
import javax.servlet.*;
import java.io.*;

public class Hello implements Servlet
{
	public void init(ServletConfig parml) throws ServletException
	{
		System.out.println("init");
	}
	
	public ServletConfig getServletConfig()
	{
		return null;
	}
	
	public void service(ServletRequest req, ServletResponse res) throws ServletException
	{
		System.out.println("service it");
		PrintWriter pw=res.getWriter();
		pw.println("hello,world!");
	}
	
	public String getServletInfo()
	{
		return "";
	}
	
	public void destroy()
	{
		System.out.println("destroy!");
	}	
}
默认分类 | 阅读 11702 次
文章评论,共0条
游客请输入验证码
文章分类