Top Description Inners Fields Constructors Methods
org.apache.catalina.filters

public Class RequestDumperFilter

extends GenericFilter
Class Inheritance
Imports
java.io.IOException, .ObjectInputStream, java.text.SimpleDateFormat, java.util.Date, .Enumeration, jakarta.servlet.FilterChain, .GenericFilter, .ServletException, .ServletRequest, .ServletResponse, jakarta.servlet.http.Cookie, .HttpServletRequest, .HttpServletResponse, org.apache.juli.logging.Log, .LogFactory

Implementation of a Filter 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.

When using this Filter, it is strongly recommended that the org.apache.catalina.filter.RequestDumperFilter logger is directed to a dedicated file and that the org.apache.juli.VerbatimFormatter is used.

Author
Craig R. McClanahan

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private transient Log
private static final String
private static final String
private static final long
private static final ThreadLocal<RequestDumperFilter.Timestamp>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
doFilter(ServletRequest
The servlet request to be processed
request
,
ServletResponse
The servlet response to be created
response
,
FilterChain
The filter chain being processed
chain
)

Implements jakarta.servlet.Filter.doFilter.

Log the interesting request parameters, invoke the next Filter in the sequence, and log the interesting response parameters.

private void
doLog(String attribute, String value)

private String
private void
Inherited from jakarta.servlet.GenericFilter:
getFilterConfiggetFilterNamegetInitParametergetInitParameterNamesgetServletContextinitinit

Field Detail

logback to summary
private transient Log log
NON_HTTP_REQ_MSGback to summary
private static final String NON_HTTP_REQ_MSG
NON_HTTP_RES_MSGback to summary
private static final String NON_HTTP_RES_MSG
serialVersionUIDback to summary
private static final long serialVersionUID

Hides jakarta.servlet.GenericFilter.serialVersionUID.

timestampback to summary
private static final ThreadLocal<RequestDumperFilter.Timestamp> timestamp

Constructor Detail

RequestDumperFilterback to summary
public RequestDumperFilter()

Method Detail

doFilterback to summary
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException

Implements jakarta.servlet.Filter.doFilter.

Log the interesting request parameters, invoke the next Filter in the sequence, and log the interesting response parameters.

Parameters
request:ServletRequest

The servlet request to be processed

response:ServletResponse

The servlet response to be created

chain:FilterChain

The filter chain being processed

Annotations
@Override
Exceptions
IOException:
if an input/output error occurs
ServletException:
if a servlet error occurs
doLogback to summary
private void doLog(String attribute, String value)
getTimestampback to summary
private String getTimestamp()
readObjectback to summary
private void readObject(ObjectInputStream ois) throws ClassNotFoundException, IOException
org.apache.catalina.filters back to summary

private final Class RequestDumperFilter.Timestamp

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final Date
private String
private final SimpleDateFormat

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

dateback to summary
private final Date date
dateStringback to summary
private String dateString
formatback to summary
private final SimpleDateFormat format

Constructor Detail

Timestampback to summary
private Timestamp()

Method Detail

updateback to summary
private void update()