O'Reilly logo

Head First Servlets and JSP, 2nd Edition by Bert Bates, Bryan Basham, Kathy Sierra

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

Add an output stream Wrapper

Let’s add a second Wrapper...

Compression filter design, version 3 (pseudocode)

image with no caption
image with no caption

1 The filter passes the request object and a custom response object to the servlet. The custom response has a special getOutputStream method.

2 When the servlet asks for an output stream, it doesn’t KNOW that it will get a “special” output stream.

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