<?xml version="1.0" encoding="UTF-8"?>
<!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at

  http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<!DOCTYPE document [
  <!ENTITY project SYSTEM "project.xml">
]>
<document url="runtime-attributes.html">

  &project;

  <properties>
    <title>Runtime attributes</title>
  </properties>

<body>

<section name="Table of Contents">
<toc/>
</section>


<section name="Introduction">
  <p>The following attributes are made available to web applications at runtime.
  Many of these attributes provide access to Tomcat internals. Attributes that
  expose Tomcat internals may be explicitly requested by name but are often
  deliberately not included when requesting a list of available attributes.</p>
</section>

<section name="Request attributes">
  <p>Request attributes are made available to web applications via a call to
  <code>ServletRequest.getAttribute(String)</code>.</p>
  <properties>
    <property name="jakarta.servlet.request.cipher_suite">
      <p>The Servlet specification defined attribute for the name of the cipher
      suite being used on an SSL connection.</p>
    </property>
    <property name="jakarta.servlet.request.key_size">
      <p>The Servlet specification defined attribute for the key size being used
      on an SSL connection.</p>
    </property>
    <property name="jakarta.servlet.request.secure_protocol">
      <p>The Servlet specification defined attribute for the name of the
      security protocol (e.g. TLSv1.3) being used on a secured connection.</p>
    </property>
    <property name="jakarta.servlet.request.ssl_session_id">
      <p>The Servlet specification defined attribute for the session ID being
      used for an SSL connection.</p>
    </property>
    <property name="jakarta.servlet.request.ssl_session_mgr">
      <p>A Tomcat specific extension to the Servlet specification that provides
      the session manager being used for an SSL connection.</p>
    </property>
    <property name="jakarta.servlet.request.X509Certificate">
      <p>The Servlet specification defined attribute for the array of
      X509Certificate objects representing the certificate chain presented by
      our client, if any.</p>
    </property>
    <property name="org.apache.catalina.ASYNC_SUPPORTED">
      <p>Does the processing chain (Servlet, Filters, Valves) for the current
      request support asynchronous processing? Each component in the chain must
      support asynchronous processing for this to be <code>true</code>.</p>
    </property>
    <property name="org.apache.catalina.NAMED">
      <p>The name of the target Servlet for the current named dispatch, if
      any.</p>
    </property>
    <property name="org.apache.catalina.core.DISPATCHER_TYPE">
      <p>The current <code>jakarta.servlet.DispatcherType</code> for the
      request.</p>
    </property>
    <property name="org.apache.catalina.core.DISPATCHER_REQUEST_PATH">
      <p>The current path (Servlet Info + Path Info) to which the request has
      been dispatched.</p>
    </property>
    <property name="org.apache.catalina.filters.RemoteIpFilter.secure">
      <p>The request attribute that is set to the value of
      <code>Boolean.TRUE</code> if the RemoteIpFilter determines that this
      request was submitted via a secure channel.</p>
    </property>
    <property name="org.apache.catalina.parameter_parse_failed">
      <p>The request attribute that is set to <code>Boolean.TRUE</code> if some
      request parameters have been ignored during request parameters parsing. It
      can happen, for example, if there is a limit on the total count of
      parseable parameters, or if parameter cannot be decoded, or any other
      error happened during parameter parsing.</p>
    </property>
    <property name="org.apache.catalina.parameter_parse_failed_reason">
      <p>The reason that the parameter parsing failed.</p>
    </property>
    <property name="org.apache.catalina.realm.GSS_CREDENTIAL">
      <p>The GSS credential for the currently authenticated user if they have
      successfully authenticated using SPNEGO authentication.</p>
    </property>
    <property name="org.apache.tomcat.peerAddr">
      <p>The request attribute set by the RemoteIpFilter, RemoteIpValve (and may
      be set by other similar components) that identifies the connection peer IP
      address.</p>
    </property>
    <property name="org.apache.tomcat.remoteAddr">
      <p>The request attribute set by the RemoteIpFilter, RemoteIpValve (and may
      be set by other similar components) that identifies for the connector the
      remote IP address claimed to be associated with this request when a
      request is received via one or more proxies. It is typically provided via
      the X-Forwarded-For HTTP header.</p>
    </property>
    <property name="org.apache.tomcat.request.forwarded">
      <p>The request attribute that is set to the value of
      <code>Boolean.TRUE</code> by the RemoteIpFilter, RemoteIpValve (and other
      similar components) that identifies a request which been forwarded via one
      or more proxies.</p>
    </property>
    <property name="org.apache.tomcat.sendfile.end">
      <p>The request attribute that can be used by a servlet to pass to the
      connector the end offset (not included) of the part of a file that is to
      be served by sendfile. The value should be <code>Long</code>. To serve the
      complete file the value should be equal to the length of the file.</p>
    </property>
    <property name="org.apache.tomcat.sendfile.filename">
      <p>The request attribute that can be used by a servlet to pass to the
      connector the name of the file that is to be served by sendfile. The value
      should be a <code>String</code> that is the canonical path of the file to
      be served.</p>
    </property>
    <property name="org.apache.tomcat.sendfile.start">
      <p>The request attribute that can be used by a servlet to pass to the
      connector the start offset of the part of a file that is to be served by
      sendfile. The value should be a <code>Long</code>. To serve the complete
      file the value should be <code>Long.valueOf(0)</code>.</p>
    </property>
    <property name="org.apache.tomcat.sendfile.support">
      <p>The request attribute that is set to the value of
      <code>Boolean.TRUE</code> if connector processing this request supports
      the use of sendfile.</p>
    </property>
  </properties>
</section>

<section name="ServletContext attributes">
  <p>ServletContext attributes are made available to web applications via a call
  to <code>ServletContext.getAttribute(String)</code>.</p>
  <properties>
    <property name="org.apache.catalina.CredentialHandler">
      <p>The CredentialHandler (if any) associated with the Realm (if any)
      that has been explicitly associated with the Context. Realms associated
      with parent containers (Hosts or Engines) are not considered.</p>
    </property>
    <property name="org.apache.catalina.deploy.alt_dd">
      <p>The alternate deployment descriptor for this web application.</p>
    </property>
    <property name="org.apache.catalina.jsp_classpath">
      <p>The class path for our application class loader (as an object of type
      String), delimited with the appropriate path delimiter for the
      platform.</p>
    </property>
    <property name="org.apache.catalina.resources">
      <p>The WebResourceRoot which is associated with the context.</p>
    </property>
    <property name="org.apache.catalina.webappVersion">
      <p>The web application version string (the text that appears after ##
      when parallel deployment is configured).</p>
    </property>
    <property name="org.apache.tomcat.InstanceManager">
      <p>The InstanceManager used to create Servlets, Filters, Listeners etc.
      for the web application.</p>
    </property>
    <property name="org.apache.tomcat.JarScanner">
      <p>The JarScanner instance used to scan the web application for
      annotations, TLDs, web fragments and similar features.</p>
    </property>
    <property name="org.apache.tomcat.util.threads.ScheduledThreadPoolExecutor">
      <p>The utility executor for this Context.</p>
    </property>
  </properties>
</section>
</body>
</document>
