Java filters, the powerfulyet under-appreciatedcomponents of the Java Servlet specification, can perform a range of useful tasks. Make them a part of your Java Web application toolkit.
by Eric Jansson
May 17, 2004
ava filters, first introduced in the Java Servlet specification 2.3, are a powerful addition to any Java Web application toolkit, yet they probably are the most under-used and under-appreciated of the servlet components. These classes intercept requests coming into and responses coming out of the Java servlet container, allowing developers to inspect and manipulate these messages, as well as take other actions based on the messages' content. Despite this useful functionality, many Java developers are unfamiliar with filters.
What makes filters so powerful is the range of tasks they can perform. For example, you can use them to:
block non-authenticated users or encrypt sensitive content as it travels back to the client
compress pages returned from your Web app in order to save bandwidth
log application access statistics
transform all your GIF images to PNG images on the fly
It's quick, easy and you get access to all the articles on DevX.
This registration/login is to allow you to read articles on devx.com. Already a member?
To become a member of DevX.com create your Member Profile by completing the form below. Membership is free!