Skip to content

feat(webapps-neo): Ship the neo webapp with the Tomcat distribution - #3884

Merged
javahippie merged 1 commit into
mainfrom
feature/3870-neo-webapp-tomcat
Oct 22, 2026
Merged

javahippie merged 1 commit into
mainfrom
feature/3870-neo-webapp-tomcat

Conversation

@javahippie

Copy link
Copy Markdown
Contributor

Related to #3870 (Tomcat part; WildFly follows in a separate PR).

What

The Tomcat distribution now contains the new web apps, disabled by default. The legacy web apps stay the standard.

disabled (default) enabled
/ 302 → /operaton/ neo SPA
/operaton/ legacy webapps legacy webapps
other neo paths 404 SPA, assets, /api/admin, /api/engine

Enable it with either

  • the system property operaton.bpm.webapp.neo.enabled=true (commented example in bin/setenv.{sh,bat}), or
  • the environment variable OPERATON_BPM_WEBAPP_NEO_ENABLED=true.

The property name matches the Spring Boot starter (operaton.bpm.webapp.neo.enabled).

How

  • New module distro/tomcat/webapp-neo → operaton-webapp-neo-tomcat.war, a WAR overlay of operaton-webapp-neo with:
    • a servlet-container web.xml that mirrors the filter chain of OperatonBpmWebappNeoInitializer (header security, session cookie, authentication, security, CSRF, empty body, cache control), plus RESTEasy servlets for /api/admin/* and /api/engine/*
    • a static config.json (same-origin backend, basic auth), which replaces the Docker placeholder file. The SPA restores the session through /api/admin/auth/user/{engine}, so no dynamic user field is needed.
  • Deployed as webapps/ROOT, like Operaton Run serves neo at /. The SPA bundle on main uses root-absolute asset and route paths, so a sub-path deployment would depend on fix(webapps-neo): Serve the SPA from a configurable sub-path #3678. The Tomcat default ROOT app is no longer shipped.
  • NeoEnabledFilter (in webapps-neo/assembly, so WildFly can reuse it) implements the on/off switch.
  • SpaFallbackFilter forwards deep links (GET/HEAD, no file extension, outside /api/, no existing resource) to index.html. It is the servlet counterpart of the starter's SpaResourceResolver.
  • Bug fix in UserAuthenticationResource: it now declares @Produces(application/json). The SPA's fetch sends Accept: */*. Jersey (Spring Boot) answers that with JSON, but RESTEasy picks application/octet-stream, so login failed with a 500 (NoMessageBodyWriterFoundFailure). This does not change behavior on Spring Boot.

Verification

  • webapps-neo/assembly: 411 tests pass, including the new NeoEnabledFilterTest, SpaFallbackFilterTest and a regression test for the @Produces annotation.
  • Smoke test of the built operaton-bpm-tomcat tar.gz on Tomcat 11.0.27:
    • disabled: / → 302 /operaton/; /tasks, /config.json, /api/admin/... → 404; legacy /operaton/app/welcome/default/ → 200
    • enabled (env var, and separately via the uncommented setenv.sh line): /, /tasks, /processes/invoice → SPA shell; /config.json → JSON; bundle assets → 200; /assets/missing.js → 404; CSP header present
    • auth with Accept: */*: XSRF cookie issued, POST without token → 403, login demo/demo → 200 JSON, whoami → 200, /api/engine/engine/default/process-definition/count → 200, anonymous → 401, logout → 200, whoami afterwards → 404
  • Not tested in a real browser.

Notes for review

  • Behavior change: webapps/ROOT of the distro no longer contains the Tomcat welcome page. With neo disabled, / now redirects to the legacy webapps.
  • bin/setenv.sh sets CATALINA_OPTS unconditionally (existing behavior), so an exported CATALINA_OPTS does not reach Tomcat. Use the uncommented line in setenv.sh, JAVA_OPTS, or the env var.
  • I did not regenerate the committed sbom.cdx.json; CI updates it.
  • Semver: additive and opt-in. The only visible change is the removed Tomcat ROOT app.

🤖 Generated with Claude Code

- adds operaton-webapp-neo-tomcat, a WAR overlay of operaton-webapp-neo
  with a servlet-container web.xml, RESTEasy for /api/admin and
  /api/engine, and a static config.json (same-origin backend, basic auth)
- deploys it as webapps/ROOT, like Operaton Run serves neo at /; the
  Tomcat default ROOT app is no longer shipped
- disabled by default, legacy webapps stay the standard: NeoEnabledFilter
  reads operaton.bpm.webapp.neo.enabled (system property) or
  OPERATON_BPM_WEBAPP_NEO_ENABLED; when off, / redirects to /operaton/
  and every other path returns 404
- SpaFallbackFilter forwards deep links to index.html, the servlet
  counterpart of the starter's SpaResourceResolver
- UserAuthenticationResource declares @produces(application/json): the
  SPA's fetch sends Accept */*, which Jersey answers with JSON but
  RESTEasy with application/octet-stream, failing login with a 500
- documents the switch in README.txt and setenv.{sh,bat}

WildFly follows separately.

related to #3870

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@javahippie javahippie added distro:tomcat Issues & changes related to the Tomcat distribution scope:webapp-neo Changes affecting the new webapps. labels Oct 20, 2026
@github-actions github-actions Bot added lang:java Pull requests that update Java code scope:tests Changes affecting only test code labels Oct 20, 2026
@sonarqubecloud

Copy link
Copy Markdown

@javahippie
javahippie merged commit fedcc76 into main Oct 22, 2026
15 checks passed
@javahippie
javahippie deleted the feature/3870-neo-webapp-tomcat branch October 22, 2026 11:35
@kthoms kthoms added this to the 2.2.0 milestone Oct 23, 2026
@kthoms kthoms added the noteworthy Should be documented in the release notes label Oct 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

distro:tomcat Issues & changes related to the Tomcat distribution lang:java Pull requests that update Java code noteworthy Should be documented in the release notes scope:tests Changes affecting only test code scope:webapp-neo Changes affecting the new webapps.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants