Package org.apache.catalina.valves
Class RequestDumperValve
- java.lang.Object
-
- org.apache.catalina.valves.ValveBase
-
- org.apache.catalina.valves.RequestDumperValve
-
- All Implemented Interfaces:
Contained
,Lifecycle
,Valve
,GlassFishValve
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.
This Valve may be attached to any Container, depending on the granularity of the logging you wish to perform.
- Version:
- $Revision: 1.3 $ $Date: 2005/12/08 01:28:25 $
- Author:
- Craig R. McClanahan
-
-
Field Summary
-
Fields inherited from class org.apache.catalina.valves.ValveBase
container, controller, debug, domain, lifecycle, log, next, oname, rb, started
-
Fields inherited from interface org.glassfish.web.valve.GlassFishValve
END_PIPELINE, INVOKE_NEXT
-
Fields inherited from interface org.apache.catalina.Lifecycle
AFTER_START_EVENT, AFTER_STOP_EVENT, BEFORE_START_EVENT, BEFORE_STOP_EVENT, INIT_EVENT, START_EVENT, STOP_EVENT
-
-
Constructor Summary
Constructors Constructor Description RequestDumperValve()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getInfo()
Return descriptive information about this Valve implementation.int
invoke(Request request, Response response)
Log the interesting request parameters, invoke the next Valve in the sequence, and log the interesting response parameters.protected void
log(String message)
Log a message on the Logger associated with our Container (if any).protected void
log(String message, Throwable t)
Log a message on the Logger associated with our Container (if any).void
postInvoke(Request request, Response response)
Log the interesting response parameters.String
toString()
Return a String rendering of this object.-
Methods inherited from class org.apache.catalina.valves.ValveBase
addLifecycleListener, backgroundProcess, createObjectName, event, findLifecycleListeners, getContainer, getController, getDebug, getDomain, getNext, getObjectName, getParentName, invoke, isStarted, removeLifecycleListener, setContainer, setController, setDebug, setNext, setObjectName, start, stop
-
-
-
-
Method Detail
-
getInfo
public String getInfo()
Return descriptive information about this Valve implementation.
-
invoke
public int invoke(Request request, Response response) throws IOException, jakarta.servlet.ServletException
Log the interesting request parameters, invoke the next Valve in the sequence, and log the interesting response parameters.- Specified by:
invoke
in interfaceGlassFishValve
- Specified by:
invoke
in classValveBase
- Parameters:
request
- The servlet request to be processedresponse
- The servlet response to be created- Returns:
INVOKE_NEXT
orEND_PIPELINE
- Throws:
IOException
- if an input/output error occursjakarta.servlet.ServletException
- if a servlet error occurs
-
postInvoke
public void postInvoke(Request request, Response response) throws IOException, jakarta.servlet.ServletException
Log the interesting response parameters.- Specified by:
postInvoke
in interfaceGlassFishValve
- Overrides:
postInvoke
in classValveBase
- Parameters:
request
- The servlet request to be processedresponse
- The servlet response to be created- Throws:
IOException
- if an input/output error occursjakarta.servlet.ServletException
- if a servlet error occurs
-
toString
public String toString()
Return a String rendering of this object.
-
log
protected void log(String message)
Log a message on the Logger associated with our Container (if any).- Parameters:
message
- Message to be logged
-
-