# Package org.apache.catalina.valves

package org.apache.catalina.valves

This package contains a variety of small Valve implementations that do not warrant being packaged separately. In addition, there is a convenience base class (`ValveBase`) that supports the usual mechanisms for including custom Valves into the corresponding Pipeline.

Other packages that include Valves include `org.apache.tomcat.logger` and `org.apache.tomcat.security`.

Related Packages
Package
Description
org.apache.catalina
org.apache.catalina.valves.rewrite
Class
Description
AbstractAccessLogValve
Abstract implementation of the Valve interface that generates a web server access log with the detailed line contents matching a configurable pattern.
AbstractAccessLogValve.AccessLogElement
AccessLogElement writes the partial message into the buffer.
AbstractAccessLogValve.ByteSentElement
Write bytes sent, excluding HTTP headers - %b, %B.
AbstractAccessLogValve.CachedElement
Marks an AccessLogElement as needing to have the value cached at the start of the request rather than just recorded at the end as the source data for the element may not be available at the end of the request.
AbstractAccessLogValve.ConnectionStatusElement
Write connection status when response is completed - %X.
AbstractAccessLogValve.CookieElement
Write a specific cookie - %{xxx}c.
AbstractAccessLogValve.DateFormatCache
Cache structure for formatted timestamps based on seconds.
AbstractAccessLogValve.ElapsedTimeElement
Write time taken to process the request - %D, %T.
AbstractAccessLogValve.ElapsedTimeElement.Style
Style for formatting elapsed time.
AbstractAccessLogValve.FirstByteTimeElement
Write time until first byte is written (commit time) in millis - %F.
AbstractAccessLogValve.HeaderElement
Write incoming headers - %{xxx}i.
AbstractAccessLogValve.HttpStatusCodeElement
Write HTTP status code of the response - %s.
AbstractAccessLogValve.IdentifierElement
Write identifier element %{xxx}L.
AbstractAccessLogValve.LocalAddrElement
Write local IP address - %A.
AbstractAccessLogValve.LogicalUserNameElement
Write remote logical username from identd (always returns '-') - %l.
AbstractAccessLogValve.MethodElement
Write request method (GET, POST, etc.) - %m.
AbstractAccessLogValve.QueryElement
Write query string (prepended with a '?'
AbstractAccessLogValve.RequestAttributeElement
Write an attribute in the ServletRequest - %{xxx}r.
AbstractAccessLogValve.RequestElement
Write first line of the request (method and request URI) - %r.
AbstractAccessLogValve.RequestURIElement
Write requested URL path - %U.
AbstractAccessLogValve.ResponseHeaderElement
Write a specific response header - %{xxx}o.
AbstractAccessLogValve.SessionAttributeElement
Write an attribute in the HttpSession - %{xxx}s.
AbstractAccessLogValve.SessionIdElement
Write user session ID - %S.
AbstractAccessLogValve.StringElement
Write any constant string.
AbstractAccessLogValve.ThreadNameElement
Write thread name - %I.
AbstractAccessLogValve.UserElement
Write remote user that was authenticated (if any), else '-' - %u.
AccessLogValve
This is a concrete implementation of `AbstractAccessLogValve` that outputs the access log to a file.
Constants
Manifest constants for the `org.apache.catalina.valves` package.
Constants.AccessLog
Constants specific to the AccessLogValve class.
CrawlerSessionManagerValve
Web crawlers can trigger the creation of many thousands of sessions as they crawl a site which may result in significant memory consumption.
ErrorReportValve
Implementation of a Valve that outputs HTML error pages.
ExtendedAccessLogValve
An implementation of the W3c Extended Log File Format.
ExtendedAccessLogValve.CookieElement
Log element that outputs the value(s) of a named cookie.
ExtendedAccessLogValve.DateElement
Log element that outputs the date in yyyy-MM-dd format for GMT.
ExtendedAccessLogValve.PatternTokenizer
Tokenizer for parsing the log pattern string.
ExtendedAccessLogValve.RequestAttributeElement
Log element that outputs a servlet request attribute value.
ExtendedAccessLogValve.RequestHeaderElement
Log element that outputs a specific request header value.
ExtendedAccessLogValve.RequestParameterElement
Log element that outputs a URL-encoded request parameter value.
ExtendedAccessLogValve.ResponseAllHeaderElement
write a specific response header - x-O(xxx)
ExtendedAccessLogValve.ResponseHeaderElement
Log element that outputs a specific response header value.
ExtendedAccessLogValve.ServletContextElement
Log element that outputs a servlet context attribute value.
ExtendedAccessLogValve.SessionAttributeElement
Log element that outputs a session attribute value.
ExtendedAccessLogValve.TimeElement
Log element that outputs the time in HH:mm:ss format.
HealthCheckValve
Simple Valve that responds to cloud orchestrators health checks.
JDBCAccessLogValve
Deprecated.
Non scalable design, and not documented.
JsonAccessLogValve
Access log valve derivative that rewrites entries as JSON.
JsonAccessLogValve.CharElement
write any char
JsonErrorReportValve
Implementation of a Valve that outputs error JSON.
LoadBalancerDrainingValve
A Valve to detect situations where a load-balanced node receiving a request has been deactivated by the load balancer (JK_LB_ACTIVATION=DIS) and the incoming request has no valid session.
ParameterLimitValve
This is a concrete implementation of `ValveBase` that allows alternative values for the Connector attributes `maxParameterCount`, `maxPartCount` and `maxPartHeaderSize` to be applied to a request.
PersistentValve
Valve that implements per-request session persistence.
ProxyErrorReportValve
Implementation of a Valve that proxies or redirects error reporting to other urls.
RemoteAddrValve
Deprecated.
This Valve will be removed in Tomcat 12 onwards.
RemoteCIDRValve
A valve that restricts access based on the remote client's IP address or CIDR block.
RemoteHostValve
Concrete implementation of `RequestFilterValve` that filters based on the remote client's host name optionally combined with the server connector port number.
RemoteIpValve
Tomcat port of mod_remoteip, this valve replaces the apparent client remote IP address and hostname for the request with the IP address list presented by a proxy or a load balancer via a request headers (e.g.
RequestFilterValve
Implementation of a Valve that performs filtering based on comparing the appropriate request property (selected based on which subclass you choose to configure into your Container's pipeline) against the regular expressions configured for this Valve.
SemaphoreValve
Implementation of a Valve that limits concurrency.
SSLValve
When using mod_proxy_http, the client SSL information is not included in the protocol (unlike mod_jk and mod_proxy_ajp).
StuckThreadDetectionValve
This valve allows to detect requests that take a long time to process, which might indicate that the thread that is processing it is stuck.
ValveBase
Convenience base class for implementations of the Valve interface.