|
hi,
when someone first enters your site he doesn't
have a session, you increment the counter, add a session to the request.
the trick is that only users that don't have a session make the counter
increment.
in your servlet you'd do sth like
this:
static int counter =0;
public void service(...) {
HttpSession sess
=null;
if ((sess =
req.getSession(false)) != null) {
// user has
already a session --> has already incremented the
counter
} else {
counter +=
1;
sess =
req.getSession(true); // add session to req
}
}
hope this helps.
-mw
|
Title: Counting hit rates from servlet more accurately!!
- Counting hit rates from servlet more accurately!! Rizwan Ahmed
- Michael Weller
