Hi
I wouldn't see this as being a '
java' thing since most wbservers logs can be run through a stats program and give you all this info.
BUT
I might look at this in the following way:
Create your own class that is 'called' on each page. It can track the IP/sessionID and keep a count of 'unique' hits, and then of all the pages these people request.
Want to know how many people are 'online'? Make a static method/field that counts the instances of this class, find some creative way to use 'finally' to deduct from this total before it's all garbage collected and you've got some pretty interesting information.
Store these in a database, package it with a nice reporting tool and you've got yourself a 'web' stats program.