Skip to content

Latest commit

 

History

History
346 lines (214 loc) · 6.82 KB

File metadata and controls

346 lines (214 loc) · 6.82 KB

Tomcat 10

By default, web applications pushed with SAP Java Buildpack 2 are running in an Apache Tomcat 10 container.

Applications can explicitly define the target application container by using the TARGET_RUNTIME environment variable in the application's manifest.yml file.

Example:


---
applications:
- name: myapp
  ...
  env:
    TARGET_RUNTIME: tomcat

The tomcat application runtime container provides the following standard APIs:

Runtime

Full Name

Supported Specification Version

tomcat

Apache Tomcat 10.1.x

Note:

Only relevant for SAP Java Buildpack 2!

Java 11 and later

Java Servlets 6.0

Java Server Pages (JSP) 3.1

Expression Language (EL) 5.0

Debugging Support for Other Languages 2.0

Java API for WebSocket 2.1

Java Authentication Service Provider Interface for Containers (JASPIC) 3.0

. . .

For a full list of specification versions, see: Apache Tomcat Versions

SAP Java Buildpack 2 provides some default configurations for the Apache Tomcat 10 application container. They can be customized by the application with the Resource Configuration feature.

Below is a list of all the placeholders than can be customized by the application, along with their default values:

Placeholder

Description

Default Value

connector.maxHttpHeaderSize

The maximum size of the request and response HTTP header, specified in bytes

8192

connector.maxPartHeaderSize

The maximum number of header bytes permitted per part in a request where the content type is multipart/form-data

512

connector.maxPartCount

The maximum total number of parts permitted in a request where the content type is multipart/form-data

50

connector.maxPostSize

The maximum size (in bytes) of the POST request, which will be handled by the container FORM URL parameter parsing. The limit can be disabled by setting the attribute's value to any integer number less than zero (0).

Note: You can use the Failed Request Filter to reject requests that exceed the default limit.

2097152 (2 MiB)

connector.maxThreads

The maximum number of request processing threads to be created by this Connector, which therefore determines the maximum number of simultaneous requests that can be handled

200

connector.encodedSolidusHandling

A string value configuring request paths containing a %2f sequence.

  • When set to reject, these request paths will be rejected with a 400 response.

  • When set to decode, these request paths will have that sequence decoded to / at the same time other %nn sequences are decoded.

  • When set to passthrough, these request paths will be processed with the %2f sequence unchanged.

reject

connector.allowTrace

A Boolean value that enables or disables the TRACE HTTP method

false

Configurations in the manifest.yml file:

  • To configure the maximum size of the HTTP header, use:

    env:
      JBP_CONFIG_RESOURCE_CONFIGURATION: "['tomcat/conf/server.xml': {'connector.maxHttpHeaderSize':1024}]"
    
  • To configure the maximum size of a header part, use:

    env:
      JBP_CONFIG_RESOURCE_CONFIGURATION: "['tomcat/conf/server.xml': {'connector.maxPartHeaderSize':256}]"
    
  • To configure the maximum number of parts in a request, use:

    env:
      JBP_CONFIG_RESOURCE_CONFIGURATION: "['tomcat/conf/server.xml': {'connector.maxPartCount':40}]"
    
  • To configure the maximum size of the POST request, use:

    env:
      JBP_CONFIG_RESOURCE_CONFIGURATION: "['tomee/conf/server.xml': {'connector.maxPostSize':800000}]"
    
  • To configure the maximum number of request processing threads, use:

    env:
      JBP_CONFIG_RESOURCE_CONFIGURATION: "['tomcat/conf/server.xml': {'connector.maxThreads':800}]"
    
  • To decode the %2f sequence of the request paths to /, use:

    env:
      JBP_CONFIG_RESOURCE_CONFIGURATION: "['tomcat/conf/server.xml': {'connector.encodedSolidusHandling':'decode'}]"
    
  • To enable the TRACE HTTP method, use:

    env:
      JBP_CONFIG_RESOURCE_CONFIGURATION: "['tomcat/conf/server.xml': {'connector.allowTrace':true}]"
    

SAP Java Buildpack 2 provides the default configurations for unlimited sessions for the Apache Tomcat 10 application container. They can be customized by the application with the Resource Configuration feature. To limit the number of active sessions, set the maxActiveSessions attribute of the Manager element in the application's context.xml file:

Example:

<Context>
  <Manager maxActiveSessions="500" />
</Context>

To set session timeout value of active sessions, set the <session-config> tag in the application's web.xml file:

Example:

<session-config>
    <session-timeout>1</session-timeout>
</session-config>

The default value of context path in the server.xml file is "" (Empty String). You can override this default value by using app_context_root in the application's manifest.yml file:

Example:


...
  env:
    JBP_CONFIG_TOMCAT: "[tomcat:{app_context_root: test_context_path}]"
...