FileDocCategorySizeDatePackage
CounterServlet.javaAPI DocExample776Thu Apr 03 15:28:42 BST 1997None

CounterServlet

public class CounterServlet extends GenericServlet
Counter Servlet This simple servlet uses server-side includes to embed a hit counter in a page.
author
Elliotte Rusty Harold
version
1.2, 3/22/96

Fields Summary
static int
count
static Date
start
Constructors Summary
Methods Summary
public voidservice(ServletRequest request, ServletResponse response)


        
      

    int temp;

    response.setContentType("text/plain");
    PrintStream ps = new PrintStream(response.getOutputStream());
    synchronized (this) {
      temp = count++;
    }
    ps.println("This servlet has been accessed " + temp + " times since " 
     + start );