Web server logs - CHAPTER 10 INTRODUCTION TO FILTERING 431 Summary
Friday, February 15th, 2008CHAPTER 10 INTRODUCTION TO FILTERING 431 Summary In this chapter, you ve been introduced to the filtering feature of Servlet 2.5 containers (such as Tomcat 5). You ve discovered the following: Filters enable web-application programmers to tap into the request-processing pipeline of the container. Filters are packaged code components in a web application, at the same level as servlets and JSP pages. Filters are deployed in the same way as servlets and JSP pages, through the deployment descriptor for the application. The filter has access to incoming requests before they reach the final resource and to the outgoing response immediately after the resource processing. Filters can also substitute their own version of the request and response (typically wrapped) for consumption of the resource. Symbiotic, well-defined interactions between the request dispatcher and filters enable you to create filters that act as in-series processors for request-switching web applications and application frameworks such as Apache s Struts and Turbine. You ve explored the life cycle of a filter, as managed by the container. You ve seen how to define filters in deployment descriptors, how to supply initialization data to a filter instance, how to specify its interaction with the request dispatcher, and how to define filter mappings. You ve noted how Servlet 2.3 is unable to filter dispatched requests and learned how Servlet 2.4 has remedied the situation. Next, we discussed the very important concept of filter chaining. You learned that Servlet 2.5 filter chaining uses a nested call mechanism, unlike most other filtering schemes. One major advantage of this approach is the preservation of thread state throughout the filter invocation. Working with code, you ve created two simple filters and practiced deploying them. You ve experimented with filter chaining and observed its effect by using log files. You ve also created a useful audit filter and learned how easily it can be constructed. Finally, we provided some guidelines for you to follow when programming filters and contrasted two other filterlike mechanisms (valves and interceptors) noting the differences in approach and level of abstraction to that of filters. This chapter has hopefully provided a sound foundation for proceeding to the next chapter, which will be code-intensive as you explore a variety of filter designs. Along the way, you ll create wrapped requests and responses to offer customized dynamic behavior throughout the request-processing pipeline.
Searching for affordable and proven webhost to host and run your servlet applications? Go to Linux Web Hosting services and you will find it.