Apache Tomcat 6.0.39

Class RequestDumperValve

  extended by org.apache.catalina.valves.ValveBase
      extended by org.apache.catalina.valves.RequestDumperValve
All Implemented Interfaces:
javax.management.MBeanRegistration, Contained, Valve

public class RequestDumperValve
extends ValveBase

Implementation of a Valve that logs interesting contents from the specified Request (before processing) and the corresponding Response (after processing). It is especially useful in debugging problems related to headers and cookies.

WARNING: Using this valve has side-effects. The output from this valve includes any parameters associated with the request. Therefore, the InputStream is consumed for requests made with the method POST and content-type application/x-www-form-urlencoded.

This Valve may be attached to any Container, depending on the granularity of the logging you wish to perform.

$Id: RequestDumperValve.java 1135572 2011-06-14 13:46:24Z markt $
Craig R. McClanahan

Field Summary
protected static StringManager sm
          The StringManager for this package.
Fields inherited from class org.apache.catalina.valves.ValveBase
container, containerLog, controller, domain, mserver, next, oname
Constructor Summary
Method Summary
 java.lang.String getInfo()
          Return descriptive information about this Valve implementation.
 void invoke(Request request, Response response)
          Log the interesting request parameters, invoke the next Valve in the sequence, and log the interesting response parameters.
 java.lang.String toString()
          Return a String rendering of this object.
Methods inherited from class org.apache.catalina.valves.ValveBase
backgroundProcess, createObjectName, event, getContainer, getContainerName, getController, getDomain, getNext, getObjectName, getParentName, postDeregister, postRegister, preDeregister, preRegister, setContainer, setController, setNext, setObjectName
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Field Detail


protected static StringManager sm
The StringManager for this package.

Constructor Detail


public RequestDumperValve()
Method Detail


public java.lang.String getInfo()
Return descriptive information about this Valve implementation.

Specified by:
getInfo in interface Valve
getInfo in class ValveBase


public void invoke(Request request,
                   Response response)
            throws java.io.IOException,
Log the interesting request parameters, invoke the next Valve in the sequence, and log the interesting response parameters.

Specified by:
invoke in interface Valve
Specified by:
invoke in class ValveBase
request - The servlet request to be processed
response - The servlet response to be created
java.io.IOException - if an input/output error occurs
javax.servlet.ServletException - if a servlet error occurs


public java.lang.String toString()
Return a String rendering of this object.

toString in class ValveBase

Apache Tomcat 6.0.39

Copyright © 2000-2014 Apache Software Foundation. All Rights Reserved.