O'Reilly logo

Sams Teach Yourself JavaServer Pages™ in 21 Days by Steven Holzner

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 14. Using Filters

Using Filters

As of Servlet Specification 2.3 (which you can download at http://jcp.org/aboutJava/communityprocess/first/jsr053/index.html), the Tomcat server supports filters. Here are today's topics:

  • Understanding filters

  • Creating a simple filter that prints to the server console

  • Chaining filters

  • Logging user access data

  • Using a filter's initialization parameters

  • Restricting access to a Web resource to particular times of the day

  • Inserting text into the response from a filter

  • Enforcing user authentication with filters

Filters are much like add-ons for your Web resources, such as JSP pages and servlets. You can use filters as a gateway for those ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required