Conclusion
This chapter presented the WebLogger project, a fun online filter that grabs data about users who access your website—without their knowledge, unless you tell them they're being logged.
To log accesses to a web resource, you don't have to change that web resource; you can use a filter in Java-enabled web servers. To create a filter, you have to create a Java class that implements the Filter interface, which includes the init, doFilter, and destroy methods. When the user accesses the resource you're filtering, the doFilter method gets control, gaining access to the request object sent to the resource and the response object the resource sends back to the browser.
WebLogger uses the request object to get its information about the user, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access