436 CHAPTER 11 ADVANCED FILTERING TECHNIQUES The (Web hosting top)

436 CHAPTER 11 ADVANCED FILTERING TECHNIQUES The Deployment Descriptor Now we need to create a deployment descriptor for this simple web application. Listing 11-3 shows a simple version of web.xml that will get us started. As we proceed through the chapter, we will add more entries to it. Listing 11-3. web.xml Pro JSP Example Filters 2 findprod com.apress.projsp.FindProd findprod /findprod A Brief Word on Terminology Before you read any further, let s clarify some of the terminology that is used throughout this chapter. Figure 11-1 shows a request from a client as the request flows through a set of filters and is handled by a web resource. Notice that Figure 11-1 shows filter 3 being applied twice to the request/response cycle. Although this is not a common practice, it is technically possible. For example, you could have an adapter filter that modifies a request. Using initialization parameters, you could control how the filter modifies the request. Thus one instance of the filter could modify one aspect of the request, and a second instance of the same filter could modify a different aspect of the request. The request originates from the client and goes through a chain of filters before reaching the final resource processor in this figure. First, the request travels from the client, through the first filter, through the second filter, and so on. We call this the downstream, or inbound, trip. The downstream trip is always toward the final goal: the resource processor. After the resource processor has finished with the request, a response then will travel upstream, or outbound, back through all the filters and onward to the client. Upstream trips are always away from the resource processor and toward the client. New to Servlet 2.4 is the ability of filters to participate in the forward and include redirection requests of the request dispatcher. This is a very important advance architecturally. We discuss this new feature in depth in the last section of this chapter.
Please visit our professional web hosting services to find out about cheap and reliable webhost service that will surely answer all your demands.

Leave a Reply