HelloWorld.java

import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;

public class HelloWorld extends HttpServlet {
  public void doGet(HttpServletRequest req, HttpServletResponse rsp)
                throws ServletException, IOException {

    rsp.setContentType("text/html");
    PrintWriter out = rsp.getWriter();

    out.println("<html>");
    out.println("<head><title> Simple Servlet </title></head>");
    out.println("<body>");
    out.println("<p>Hello World <p>");
    out.println("</body></html>");
  }
}

Generated by GNU enscript 1.6.4.