418 CHAPTER 10 INTRODUCTION TO FILTERING The filter application order has been determined by the order that the elements occur in the web.xml file. For example, consider the following set of filter mappings: Audit Filter /* Authentication Filter /* In this case, both Audit Filter and Authentication Filter are mapped to all resources served by this server both filters will be applied to all resources. The order of application will be Audit Filterfollowed by Authentication Filter. Remember that the order of chained filter execution on the incoming request is down the filter stack, whereas the order of chained filter execution on the outgoing path is up the filter stack. Given an incoming request, the container will go through the list of filter mappings to determine which filter to apply on a per-request basis. For example, say you have the following filter mappings defined in order: Audit Filter /* Authentication Filter /servlet/* Visual Audit Filter mylocate An incoming request for http://tomcathost/myapp/index.html will have the following filter applied: Audit Filter In contrast, an incoming request for http://tomcathost/myapp/servlet/listprodwill have the following filters applied in order: Audit Filter Authentication Filter
Looking for affordable and reliable webhost to host and run your business application? Then look no more and go to servlet web hosting services.
This entry was posted
on Saturday, February 2nd, 2008 at 9:12 am and is filed under Jsp.
You can follow any responses to this entry through the RSS 2.0 feed.
You can leave a response, or trackback from your own site.