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.
--- 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
|
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 |
|---|---|---|
|
|
The maximum size of the request and response HTTP header, specified in bytes |
8192 |
|
|
The maximum number of header bytes permitted per part in a request where the content type is |
512 |
|
|
The maximum total number of parts permitted in a request where the content type is |
50 |
|
|
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) |
|
|
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 |
|
|
A string value configuring request paths containing a
|
reject |
|
|
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
%2fsequence 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:
<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:
<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:
... env: JBP_CONFIG_TOMCAT: "[tomcat:{app_context_root: test_context_path}]" ...