Skip to content

Latest commit

 

History

History
256 lines (136 loc) · 4.01 KB

tomcat-ddfc101.md

File metadata and controls

256 lines (136 loc) · 4.01 KB

Tomcat

By default web applications pushed with the SAP Java buildpack are running in an Apache Tomcat container.

Applications could explicitly define the targeted application container by using the TARGET_RUNTIME environment variable in the application manifest.yml file.

Sample Code:

manifest.yml

---
applications:
- name: <APP_NAME>
  ...
  env:
    TARGET_RUNTIME: tomcat

The tomcat application runtime container provides the following standard APIs:

Runtime

Tomcat

Supported Specification Version

tomcat

Apache Tomcat 8

Java Servlets 3.1

Java ServerPages (JSP) 2.3

Expression Language (EL) 3.0

Debugging Support for Other Languages 1.0

Java API for WebSocket 1.1

SAP Java Buildpack provides some default configurations for the Tomcat application container which could be customized by the application with the Resource Configuration feature.

Below is a list with all of the placeholders which could 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.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.allowTrace

A boolean value which can be used to enable or disable the TRACE HTTP method

false

To configure the HTTP header size, use:

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

To configure the maximum number of threads, use:

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

To enable the TRACE HTTP method, use:

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

The SAP Java Buildpack provides the default configurations for unlimited sessions for the Tomcat application container which could be customized by the application with the Resource Configuration feature. To limit the number of active sessions set the maxActiveSessions attribute on a Manager element, for example:

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

To set session timeout value of active sessions set the session-config tag in the application web.xml:

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

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

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