CHAPTER 10 INTRODUCTION TO FILTERING 425 Listing 10-5. web.xml ProJSP Example Filters Simple Filter com.apress.projsp.filters.SimpleFilter Simple Filter 2 com.apress.projsp.filters.SimpleFilter2 Simple Filter /* Simple Filter 2 /* This mapping now maps both SimpleFilter and SimpleFilter2 to all resources being accessed. This effectively chains them for all resources. Deploy the new web application to Tomcat. Clear the log files, start Tomcat, access the URL http://localhost:8080/filters1/ again, and then shut down Tomcat. Now, open the log file again and you should see something similar to the following: 2005-07-27 10:21:52 StandardContext[/filters1]in SimpleFilter 2005-07-27 10:21:52 StandardContext[/filters1]in SimpleFilter2 2005-07-27 10:21:53 StandardContext[/filters1]leaving SimpleFilter2 2005-07-27 10:21:53 StandardContext[/filters1]Getting out of SimpleFilter Notice the nesting of the log entries, which clearly show that the filter-chaining mechanism consists of a series of nested doFilter() calls on the two participating filters. The
In case you need quality webspace to host and run your web applications, try our personal web hosting services.
This entry was posted
on Saturday, February 9th, 2008 at 11: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.