Skip to content

Commit 267ada6

Browse files
committed
docs: document context_path implementation difference between Ruby and Go buildpack (§2A.11)
1 parent 937509c commit 267ada6

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

RUBY_VS_GO_BUILDPACK_COMPARISON.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,7 @@ func (t *TomcatContainer) Supply() error {
445445
| **Logging Support** | `TomcatLoggingSupport` | `installTomcatLoggingSupport()` | ✅ Complete | Installs `tomcat-logging-support.jar` (CloudFoundryConsoleHandler) |
446446
| **setenv.sh Generation** | `TomcatSetenv` | `createSetenvScript()` | ✅ Complete | Creates `bin/setenv.sh` for CLASSPATH |
447447
| **Utils (XML helpers)** | `TomcatUtils` | N/A | ✅ Complete | Go uses standard library XML parsing |
448+
| **Context Path** | `TomcatInstance#root` (webapps dir rename) | `contextXMLFilename()` + context descriptor | ✅ Complete | Same config key; different mechanism — see §2A.11 |
448449
| **Geode/GemFire Session Store** | `TomcatGeodeStore` (199 lines) | **❌ Missing** | ❌ Not Implemented | Session clustering for Tanzu GemFire |
449450
| **Redis Session Store** | `TomcatRedisStore` (118 lines) | **❌ Missing** | ❌ Not Implemented | Session clustering for Redis |
450451
| **Spring Insight Support** | `TomcatInsightSupport` (51 lines) | **❌ Missing** | ⚠️ Deprecated | Spring Insight deprecated by VMware |
@@ -849,6 +850,7 @@ cf set-env myapp JBP_CONFIG_TOMCAT '{tomcat: {version: 9.0.+}}'
849850
| **External Configuration** | ⚠️ 90% | Go requires manifest (no runtime repository_root) |
850851
| **Lifecycle Support** | ✅ 100% | Both detect startup failures |
851852
| **Logging Support** | ✅ 100% | Both use CloudFoundryConsoleHandler |
853+
| **Context Path** | ✅ 100% | Same config key and URL behavior; implementation differs (see §2A.11) |
852854
| **Session Store Auto-Config** | ⚠️ 0% | Go missing convenience auto-configuration (manual setup possible) |
853855
| **Overall** | ⚠️ **95%** | Core features complete; auto-config conveniences missing |
854856

@@ -875,6 +877,22 @@ cf set-env myapp JBP_CONFIG_TOMCAT '{tomcat: {version: 9.0.+}}'
875877
3. Read `VCAP_SERVICES` in application code (if needed)
876878
4. Test with Go buildpack → Deploy
877879

880+
### 2A.11 Context Path: Implementation Difference
881+
882+
Both buildpacks support `context_path` via `JBP_CONFIG_TOMCAT`, but use different Tomcat mechanisms:
883+
884+
| Aspect | Ruby (4.x) | Go (5.x) |
885+
|--------|-----------|---------|
886+
| **Mechanism** | Deploys app into `tomcat/webapps/<name>/` | Writes `conf/Catalina/localhost/<name>.xml` context descriptor |
887+
| **App location** | `tomcat/webapps/foo#bar/` | `${user.home}/app` (unchanged) |
888+
| **Root context prevention** | No `ROOT` directory in webapps | `ROOT.xml` explicitly removed when non-root path set |
889+
| **Config key** | `tomcat.context_path` | `tomcat.context_path` (identical) |
890+
| **URL result** | App at `/foo/bar` only | App at `/foo/bar` only (identical) |
891+
892+
**Migration impact**: None for users. The `context_path` config key and resulting URL routing are identical between 4.x and 5.x. This is a smooth transition.
893+
894+
**Caveat**: `ServletContext.getRealPath()` and webapps-relative path assumptions may behave differently — the Go buildpack serves from `${user.home}/app` rather than a webapps subdirectory. This is a pre-existing structural difference between the two buildpacks, not specific to `context_path`.
895+
878896
---
879897

880898
## 2B. Container Feature Parity: Complete Analysis

0 commit comments

Comments
 (0)