Help coderanch get a
new server
by contributing to the fundraiser

haoxiang guo

Greenhorn
+ Follow
since Mar 04, 2006
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by haoxiang guo

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

public class HolisticCounter extends HttpServlet {

static int classCount = 0; // shared by all instances
int count = 0; // separate for each servlet
static Hashtable instances = new Hashtable(); // also shared

public void doGet(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException {
res.setContentType("text/plain");
PrintWriter out = res.getWriter();

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

// Keep track of the instance count by putting a reference to this
// instance in a hashtable. Duplicate entries are ignored.
// The size() method returns the number of unique instances stored.
instances.put(this, this);
out.println("There are currently " +
instances.size() + " instances.");

classCount++;
out.println("Across all instances, this servlet class has been " +
"accessed " + classCount + " times.");
}
}

can anyonn expalin the result
18 years ago
CAN I KNOW WHERE THE APPLET BE DOWNLOADED IN LOCAL MACHINE
18 years ago
I use JPCAP to catch a IP packet,,How can I know its protocol in application layer