434 CHAPTER 11 ADVANCED FILTERING TECHNIQUES First (Web host server)
434 CHAPTER 11 ADVANCED FILTERING TECHNIQUES First we ll present the functionality and design considerations for each filter. Then we ll provide the actual code, annotated with detailed comments highlighting the design issues addressed. Finally, we ll give detailed deployment, configuration, and testing information for each filter. Many filter applications fall into one or more of the five problem domains, so the code we ll present serves as a base for your own filter development. Furthermore, during the development of several of this chapter s filters, we ll pause to cover the main techniques used in filter programming. These are the very same filter application patterns that you ll see again and again when designing filters they re an encapsulation of the type of work that a filter can perform, on a conceptual level. An understanding of these patterns can prove helpful in your own experimentation and application of filters. Table 11-2 lists the techniques used in the various filter examples of this chapter. Table 11-2. Techniques and Filters Covered in This Chapter Technique Illustrated Filter Transforming incoming request headers Adapter filter Stopping downstream request flow Authorization filter Authentication filter Generating response Authorization filter Authentication filter Transforming outgoing response content Auditing filter Dynamically adapting filter behavior based on incoming requests Authentication filter Wrapping request objects Adapter filter Wrapping response objects Auditing filter Adding to or modifying the attributes of a request in a processing Pipeline processing filter pipeline Authentication filter Interacting with the request dispatcher s include() and forward() Pipeline processing filter actions Be warned that this chapter is extremely code intensive. By the end of the chapter, you ll be fluent in filter concepts, design, and programming. To boot, you ll have an extensive code framework and library to start your filter projects immediately. Setting Up the Development Environment If you download the code for this book, you will find that most of the code for the filters in this chapter is in a package called com.apress.projsp. The classes are located under the filters2WEB-INFclasses directory. In this chapter, several resources will be used to show the results of filter processing. As with Chapter 10, for the most part we won t care about the actual resource, so the processing done by the JSP or other resource will be minimal.
We would like to recommend you tested and proved virtual web hosting services, which you will surely find to be of great quality.