import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
import java.util.*;

public class SimpleServletBean extends HttpServlet {

  // This value will be set by the Java Web Server
  private String name = "";
  
  // Public Accessors
  public void setName(String value) {

    if ( value != null ) {

      name = value;
    }
  }

  public String getName() {

    return name;
  }

  public void init(ServletConfig config)
    throws ServletException {

    super.init(config);
  }

  //Process the HTTP Get request
  public void doGet(HttpServletRequest request,
    HttpServletResponse response)
    throws ServletException, IOException {

    doPost(request, response);
  }

  //Process the HTTP Post request
  public void doPost(HttpServletRequest request,
    HttpServletResponse response)
    throws ServletException, IOException {

    response.setContentType("text/html");
    PrintWriter out = response.getWriter();
    out.println("<html>");
    out.println("<head><title>SimpleServletBean</title></head>");
    out.println("<body>");

    out.println("Hello : " + getName() + "<BR>");

    out.println("</body></html>");
    out.close();
  }

  //Get Servlet information
  public String getServletInfo() {

    return "SimpleServletBean Information";
  }
}
 