---摘自互联网
import Java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
1. public class FirstServlet extends HttpServlet {
2. public void doGet(
3. HttpServletRequest request, HttpServletResponse response)
4. throws ServletException, IOException {
5. PrintWriter out = response.getWriter();
6. out.println("The First Servlet Worked !");
}
}