posted 12 years ago
It's a very open ended question.
Now if you say you just want the counter, define a static variable and keep on incrementing that variable. But if you go via this approach then you will have to take care of the IP addresses from which the request is coming.
The reason that I am saying about the IP addresses is say you hit the index.jsp from your machine 10 times then that should not increment the counter to 10. Perhaps you can look at Google Analytics.