<?xml version="1.0" encoding="UTF-8"?>
<document>

  <properties>
    <author>Apache Tomcat Project</author>
    <title>Migration Guide - Tomcat 10.0.x</title>
  </properties>

<body>

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

<section name="General">

<p>Please read the general <a href="migration.html">Migration Guide page</a>
first, for common considerations that apply to migration or upgrade between
versions of Apache Tomcat<sup>&#174;</sup>.</p>

</section>

<section name="Migrating from 9.0.x to 10.0.x">

  <p>This section lists all the known changes between 9.0.x and 10.0.x
  which may cause backwards compatibility problems when upgrading.</p>

  <subsection name="Java 8 required">

    <p>Apache Tomcat 10.0.x requires Java 8 or later. This is unchanged from
    Tomcat 9.0.x.</p>

  </subsection>

  <subsection name="Specification APIs">

    <p>Apache Tomcat 10 supports the Jakarta Servlet 5.0,
    Jakarta Pages 3.0, Jakarta Expression Language 4.0,
    JakartaWebSocket 2.0 and Jakarta Authentication 2.0
    <a href="https://cwiki.apache.org/confluence/display/TOMCAT/Specifications">specifications</a>.
    </p>

    <p>There is a significant breaking change between Tomcat 9.0.x and Tomcat
    10.0.x. The Java package used by the specification APIs has changed from
    <scode>javax...</scode> to <scode>jakarta...</scode>. It will be necessary
    to recompile web applications against the new APIs.</p>

    <p>Tomcat can convert an existing web application from Java EE 8
    to Jakarta EE 9 at deployment time using the Apache Tomcat migration tool
    for Jakarta EE. To make use of the feature, the web application should
    be placed in the Host <code>legacyAppBase</code> folder (by default named
    <code>webapps-javaee</code>) and they will be converted to an equivalent
    Jakarta EE web application in the Host <code>appBase</code> folder (by
    default named <code>webapps</code>).</p>

    <p>Alternately, the <a href="download-migration.cgi">Apache Tomcat
    migration tool for Jakarta EE</a> or any similar conversion tool can be
    used ahead of time to benefit from faster deployment time and more
    precise conversion configuration options.</p>

  </subsection>
  
  <subsection name="Servlet 5.0 API">
  
    <p>The Java package has changed from <scode>javax.servlet</scode> to
    <scode>jakarta.servlet</scode>.</p>

  </subsection>

  <subsection name="Pages 3.0">
  
    <p>The Java package has changed from <scode>javax.servlet.jsp</scode> to
    <scode>jakarta.servlet.jsp</scode>.</p>

  </subsection>

  <subsection name="Expression Language 4.0">
  
    <p>The Java package has changed from <scode>javax.el</scode> to
    <scode>jakarta.el</scode>.</p>

  </subsection>

  <subsection name="WebSocket 2.0">

    <p>The Java package has changed from <scode>javax.websocket</scode> to
    <scode>jakarta.websocket</scode>.</p>
    
  </subsection>

  <subsection name="Authentication 2.0">
  
    <p>The Java package has changed from <scode>javax.security.auth.message</scode> to
    <scode>jakarta.security.auth.message</scode>.</p>

  </subsection>

  <subsection name="Internal APIs">
  
    <p>Whilst the Tomcat 10 internal API is broadly compatible with Tomcat 9
    there have been many changes at the detail level and they are not binary
    compatible. Developers of custom components that interact with Tomcat&apos;s
    internals should review the JavaDoc for the relevant API.</p>

    <p>Of particular note are:</p>
    <ul>
      <li><scode>GenericPrincipal.getPassword()</scode> has been removed.</li>
    </ul>

  </subsection>

  <subsection name="System properties">

    <p>Support for many of the Tomcat specific system properties has been
    removed and the system property replaced with an attribute on the
    appropriate component such as the Connector, Context or Manager.</p>

  </subsection>

  <subsection name="web.xml defaults">

    <p><code>conf/web.xml</code> sets the default request and response character
    encoding to UTF-8.</p>

  </subsection>

  <subsection name="Session management">

    <p>Session persistence on restart has been disabled by default. It may be
    re-enabled globally in <scode>conf/context.xml</scode> or per web
    application.</p>

  </subsection>  
  
  <subsection name="HTTP/2">

    <p>The configuration settings that were duplicated between the HTTP/1.1 and
    HTTP/2 connectors have been removed from the HTTP/2 connector which will now
    inherit them from the associated HTTP/1.1 connector.</p>

  </subsection>

  <subsection name="Logging">

    <p>The logging implementation now only creates log files once there is
    something to write to the log files.</p>

  </subsection>

  <subsection name="Access Log Patterns">

    <p>To align with httpd, the <code>%D</code> pattern now logs request time in
    microseconds rather than milliseconds. To log request time in milliseconds,
    use <code>%{ms}T</code>.</p>

  </subsection>

</section>

<section name="Upgrading 10.0.x">

  <p>When upgrading instances of Apache Tomcat from one version of Tomcat 10 to
  another, particularly when using separate locations for $CATALINA_HOME and
  $CATALINA_BASE, it is necessary to ensure that any changes in the
  configuration files such as new attributes and changes to defaults are applied
  as part of the upgrade. To assist with the identification of these changes,
  the form below may be used to view the differences between the configuration
  files in different versions of Tomcat 10.</p>

  <subsection name="Tomcat 10.0.x noteable changes">
    <p>The Tomcat developers aim for each patch release to be fully backwards
       compatible with the previous release.  Occasionally, it is necessary to
       break backwards compatibility in order to fix a bug. In most cases, these
       changes will go unnoticed. This section lists changes that are not fully
       backwards compatible and might cause breakage when upgrading.</p>
    <ul>
      <li><p>In 10.0.3 onwards, the semantics of the
        <code>HostConfig.check(String)</code> method have changed. Rather than
        marking the application as serviced before calling the method, the
        method will mark the application as serviced before checking
        resources and then un-mark the application as being serviced after the
        checks are complete. If the application is marked as serviced when the
        method is called, the method will be a NO-OP.</p>
      </li>
      <li><p>In 10.0.9 onwards, Tomcat no longer adds an "Expires" HTTP
        response header when adding "Cache-Control: private" due to a
        CONFIDENTIAL transport-guarantee. This will likely cause a change
        in caching behavior for applications that do not explicitly set
        their own headers but rely on Tomcat's previous behavior. If you
        wish to disable caching, you will need to configure it explicitly
        in your application. See <a href="https://bz.apache.org/bugzilla/show_bug.cgi?id=65513">BZ 65513</a>
        for more information.</p>
      </li>
      <li><p>In 10.0.11 onwards, as a result of the updated fork of Commons
        FileUpload now using <code>java.nio.file.Files</code>, applications
        using multi-part uploads need to ensure that the JVM is configured with
        sufficient direct memory to store all in progress multi-part
        uploads.</p>
      </li>
      <li><p>In 10.0.14 onwards, the system property
        <code>org.apache.juli.AsyncLoggerPollInterval</code> is no longer
        used.</p>
      </li>
    </ul>
  </subsection>

  <subsection name="Tomcat 10.0.x configuration file differences">

    <p>Select a configuration file, old version and new version from the boxes
    below and then click &quot;View differences&quot; to see the differences.
    The differences will be shown in a new tab/window.</p>

    <p><b>Note:</b> If there are no differences you will see an error page.</p>

    <form action="https://gitbox.apache.org/filediff"
          method="get"
          target="_blank">

    <input type="hidden" name="repo" value="tomcat.git"/>

    <p><label>Configuration file:
    <select name="file">
    <option value="conf" selected="selected">All configuration files</option>
    <option value="conf/catalina.policy">catalina.policy</option>
    <option value="conf/catalina.properties">catalina.properties</option>
    <option value="conf/context.xml">context.xml</option>
    <option value="conf/logging.properties">logging.properties</option>
    <option value="conf/server.xml">server.xml</option>
    <option value="conf/tomcat-users.xml">tomcat-users.xml</option>
    <option value="conf/web.xml">web.xml</option>
    </select></label>
    </p>
    <p><label>Old version:
    <select name="origin">
    <option value="10.0.0-M1">10.0.0-M1</option>
    <option value="10.0.0-M3">10.0.0-M3</option>
    <option value="10.0.0-M4">10.0.0-M4</option>
    <option value="10.0.0-M5">10.0.0-M5</option>
    <option value="10.0.0-M6">10.0.0-M6</option>
    <option value="10.0.0-M7">10.0.0-M7</option>
    <option value="10.0.0-M8">10.0.0-M8</option>
    <option value="10.0.0-M9">10.0.0-M9</option>
    <option value="10.0.0-M10">10.0.0-M10</option>
    <option value="10.0.0">10.0.0</option>
    <option value="10.0.2">10.0.2</option>
    <option value="10.0.4">10.0.4</option>
    <option value="10.0.5">10.0.5</option>
    <option value="10.0.6">10.0.6</option>
    <option value="10.0.7">10.0.7</option>
    <option value="10.0.8">10.0.8</option>
    <option value="10.0.10">10.0.10</option>
    <option value="10.0.11">10.0.11</option>
    <option value="10.0.12">10.0.12</option>
    <option value="10.0.13">10.0.13</option>
    <option value="10.0.14">10.0.14</option>
    <option value="10.0.16">10.0.16</option>
    <option value="10.0.17">10.0.17</option>
    <option value="10.0.18">10.0.18</option>
    <option value="10.0.20">10.0.20</option>
    <option value="10.0.21">10.0.21</option>
    <option value="10.0.22">10.0.22</option>
    <option value="10.0.23">10.0.23</option>
    <option value="10.0.26" selected="selected">10.0.26</option>
    <option value="10.0.27">10.0.27</option>
    </select>,</label> <label>new version:
    <select name="target">
    <option value="10.0.0-M1">10.0.0-M1</option>
    <option value="10.0.0-M3">10.0.0-M3</option>
    <option value="10.0.0-M4">10.0.0-M4</option>
    <option value="10.0.0-M5">10.0.0-M5</option>
    <option value="10.0.0-M6">10.0.0-M6</option>
    <option value="10.0.0-M7">10.0.0-M7</option>
    <option value="10.0.0-M8">10.0.0-M8</option>
    <option value="10.0.0-M9">10.0.0-M9</option>
    <option value="10.0.0-M10">10.0.0-M10</option>
    <option value="10.0.0">10.0.0</option>
    <option value="10.0.2">10.0.2</option>
    <option value="10.0.4">10.0.4</option>
    <option value="10.0.5">10.0.5</option>
    <option value="10.0.6">10.0.6</option>
    <option value="10.0.7">10.0.7</option>
    <option value="10.0.8">10.0.8</option>
    <option value="10.0.10">10.0.10</option>
    <option value="10.0.11">10.0.11</option>
    <option value="10.0.12">10.0.12</option>
    <option value="10.0.13">10.0.13</option>
    <option value="10.0.14">10.0.14</option>
    <option value="10.0.16">10.0.16</option>
    <option value="10.0.17">10.0.17</option>
    <option value="10.0.18">10.0.18</option>
    <option value="10.0.20">10.0.20</option>
    <option value="10.0.21">10.0.21</option>
    <option value="10.0.22">10.0.22</option>
    <option value="10.0.23">10.0.23</option>
    <option value="10.0.26">10.0.26</option>
    <option value="10.0.27" selected="selected">10.0.27</option>
    <option value="HEAD">trunk (unreleased)</option>
    </select></label>
    </p>

    <p>
    <button>View Differences</button>
    </p>
    </form>
    <p>You can also use a Git command similar to the following from within a
       working copy:</p>
    <source>git diff 10.0.0 10.0.12 -- conf/</source>
  </subsection>
  
</section>

</body>
</document>
