Apache Tomcat has two primary ways of processing the request/response stream: servlet filters and valves. Unlike the servlet filters, Tomcat Valves are used through the configuration of the application server. There are many factors in which the Valve can be configured, whether it be for all applications on the server, a subset of applications, or just a single application. Channing Benson,Senior Consultant with the SpringSource division of VMware, wrote an interesting article for a crashcourse on understanding how the valve component flows and how to configure it properly.

Benson uses two different valves in order to illustrate how valves logically flow and therefore how they should be configured. First, he uses the ThreadDiagnosticsValve, which ships with VMware’s vFabric tc Server and is commonly used to collect monitoring diagnostic information on application requests/ responses. The second valve, a RandomDelayValve is a simple valve Benson wrote that adds sleep calls of varying lengths to a specified percentage of requests. Used together, Benson implements the RandomDelayValve to create long-running requests and usethe ThreadDiagnosticsValve in succession to monitor and report on the requests that exceed the response threshold.

Click here to see the full article about how to properly configure Tomcat values: Apache Tomcat Valves – Understanding the Pipeline.