FileDocCategorySizeDatePackage
SimpleCounter.javaAPI DocExample555Tue Jan 25 10:45:14 GMT 2000None

SimpleCounter

public class SimpleCounter extends HttpServlet

Fields Summary
int
count
Constructors Summary
Methods Summary
public voiddoGet(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)


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

    int local_count;
    synchronized(this) {
      local_count = ++count;
    }

    out.println("Since loading, this servlet has been accessed " +
                local_count + " times.");