HelloName.java

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

public class HelloName extends HttpServlet {

  public void doGet(HttpServletRequest req, HttpServletResponse res)
                               throws ServletException, IOException {

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

    // Read the value of the parameter passed in the address bar
    String name = req.getParameter("name");

    out.println("<HTML>");
    out.println("<HEAD><TITLE>Hello, " + name + "</TITLE></HEAD>");
    out.println("<BODY>");
    out.println("Hello " + name);
    out.println("</BODY></HTML>");
  }
}

Generated by GNU enscript 1.6.4.