---摘自互聯網
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 !");
}
}