import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
import java.util.*;

public class CounterServletBean extends HttpServlet {

  private int count;

  public void setCount(int value) {

    count = value;
  }

  public int getCount() {

    return count;
  }

  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 {

    response.setContentType("text/html");
    PrintWriter out = response.getWriter();

    out.println("<html>");
    out.println("<head><title>CounterServletBean</title></head>");
    out.println("<body>");

    out.println("You are visitor : " + count++ + "<BR>");
    
    out.println("</body></html>");
    out.close();
  }
//Get Servlet information
  
  public String getServletInfo() {
    return "CounterServletBean Information";
  }
}
 