feat: consume bootstrap via struts webjars (5.3.8 + icons 1.13.1) - #423
Merged
Conversation
…umer) Requirements/design spec for adding first-class WebJars support to Struts core, served through the static-content pipeline with version-less path resolution, and consuming it from the struts2-bootstrap plugin to replace the ~2000 manually-vendored Bootstrap/bootstrap-icons files. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Self-contained, repo-portable framework-only spec to start WebJars support work fresh in apache/struts. Plugin-side consumer work continues here once the framework support ships. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Framework support merged (apache/struts PR #1765, WW-5640, in 7.2.2-SNAPSHOT). Plan covers pom deps + struts 7.2.2 floor, head.ftl -> <@s.webjar>, removal of vendored bootstrap/bootstrap-icons, README, and showcase verification. Coding deferred until Struts 7.2.2 is released. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Build against 7.2.2-SNAPSHOT (Apache snapshots repo) until 7.2.2 is released. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The <#assign>..</#assign> capture of <@s.webjar> yields a FreeMarker
markup_output, which ?trim rejects. Use the tag's var attribute (stored in
the value-stack context) and reference it through OGNL %{#var} in
<@s.script>/<@s.link> src/href (both OGNL-evaluated via findString).
Verified end-to-end in the showcase: bootstrap css/js, icons css and woff2
all serve 200.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
lukaszlenart
force-pushed
the
docs/webjars-support-design
branch
from
August 25, 2026 09:22
e18d3f1 to
5fe0911
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Replaces the plugin's ~2000 manually-vendored Bootstrap and bootstrap-icons files with
org.webjarsdependencies, served via Struts core's WebJars support (<@s.webjar>/ apache/struts WW-5640, PR apache/struts#1765).org.webjars:bootstrap+org.webjars.npm:bootstrap-icons.head.ftlresolves asset URLs through<@s.webjar path="…" var="…"/>and composes them into<@s.script>/<@s.link>via OGNL%{#var}.template/bootstrap/css/**,template/bootstrap/bootstrap-icons/**, andtemplate/bootstrap/js/bootstrap*. Keeps the plugin's ownvalidation.js/validation.min.js.Why
Every Bootstrap release previously required re-downloading and re-committing ~2000 files by hand. WebJars turn that into a dependency bump.
Ready to merge
An earlier revision of this PR was blocked on an unreleased Struts (
7.2.2-SNAPSHOT) and carried a temporary Apache snapshots repository. That blocker is gone:release/6.0.xnow builds against Struts 7.3.0 (Update struts2.version to v7.3.0 #425), which ships the WebJars support (WebJar,WebJarModel,StrutsWebJarUrlProvider).release/6.0.x, and the temporaryapache-snapshots<repositories>block has been removed — everything resolves from Maven Central.The README compatibility row keeps
version >= 7.2.2as the declared floor, since 7.2.2 is the first release containing WebJars support.Verification
Full reactor
mvn clean install(JDK 17) is green after the rebase, and resolves:Runtime behaviour was verified end-to-end via the showcase (
mvn -pl struts2-bootstrap-showcase jetty:run):…/static/webjars/bootstrap/5.3.8/css/bootstrap.min.css→200 text/css…/static/webjars/bootstrap/5.3.8/js/bootstrap.bundle.min.js→200 text/javascript…/static/webjars/bootstrap-icons/1.13.1/font/bootstrap-icons.min.css→200 text/css…/static/webjars/bootstrap-icons/1.13.1/font/fonts/bootstrap-icons.woff2→200 font/woff2(confirms the icons CSS relative./fonts/path resolves)validation.min.jsstill served from the plugin static path →200Notes
6.1.1(matches currentpom.xml); adjust if a different version is intended.docs/superpowers/. Those documents are historical records of the design work and still refer to7.2.2/7.2.2-SNAPSHOTas the target at the time.Closes #363
🤖 Generated with Claude Code