posted 19 years ago
Ok, I've worked it out and now able to track visitors. Thanks for direction. The code is below. It only tracks and doesn't count current visitors (for that I have a SessionListener). Visits are stored in the database and allow for tracking of what visitor actually went through. This assumes that new session is a new visitor (maybe not entirely correct, but I just can't think of anything better). Enjoy:
Tracker.java (filter)
===============================
web.xml
==========================================
<filter>
<filter-name>Tracker</filter-name>
<filter-class>com.fototalk.filters.Tracker</filter-class>
</filter>
<filter-mapping>
<filter-name>Tracker</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>