How to log or view the pages being accessed by the user in Tomcat.
If you are working on Tomcat, and you are looking for a Tomcat specific solution (not portable), then you can use the Tomcat 4.x valves, that can be considered as a server-level version of Servlets 2.3 Filters. You can start from The Valve Component, but you will need to take a look at the Tomcat 4.x javadocs for further information.
You can also consider to extends one of the different Loggers that Tomcat 4.x provides. They are also a good example of Valves. Even in this case, start from The Logger Component, but considering referring to the Tomcat 4.x javadocs.
By the way, the Filter concept was originally developed in Tomcat 3.x with the name of "interceptors"...