package com.sprying;
import java.io.PrintWriter;
import javax.servlet.GenericServlet;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
/**
*第二种方法开发servlet,
*继承GenericServlet,只要重写Service方法
*/
public class GenericExample extends GenericServlet
{
/**
*
*/
private static final long serialVersionUID = -8315318427851675298L;
public void service(ServletRequest req,ServletResponse res)
{
try
{
PrintWriter pw=res.getWriter();
pw.print("HelloWorld,extends of GenericServlet!!!");
}catch(Exception e)
{
e.printStackTrace();
}
}
}