[
https://issues.apache.org/jira/browse/WW-5653?focusedWorklogId=1031150&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-1031150
]
ASF GitHub Bot logged work on WW-5653:
--------------------------------------
Author: ASF GitHub Bot
Created on: 19/Jul/26 18:59
Start Date: 19/Jul/26 18:59
Worklog Time Spent: 10m
Work Description: Copilot commented on code in PR #1793:
URL: https://github.com/apache/struts/pull/1793#discussion_r3611159531
##########
apps/showcase/src/main/webapp/WEB-INF/decorators/main.jsp:
##########
@@ -61,20 +61,20 @@
<title><sitemesh:write property="title"/></title>
- <s:url var="bootstrapCss" value='/styles/bootstrap.css' encode='false'
includeParams='none'/>
- <s:link href="%{bootstrapCss}" rel="stylesheet" type="text/css"
media="all"/>
+ <link rel="stylesheet" type="text/css" media="all" href="<s:webjar
path='bootstrap/css/bootstrap.min.css'/>"/>
+ <link rel="stylesheet" type="text/css" href="<s:webjar
path='bootstrap-icons/font/bootstrap-icons.min.css'/>"/>
<s:url var="mainCss" value='/styles/main.css' encode='false'
includeParams='none'/>
<s:link href="%{mainCss}" rel="stylesheet" type="text/css" media="all"/>
- <s:url var="jqueryJs" value='/js/jquery-2.1.4.min.js' encode='false'
includeParams='none'/>
- <s:script src="%{jqueryJs}"/>
- <s:url var="bootstrapJs" value='/js/bootstrap.min.js' encode='false'
includeParams='none'/>
- <s:script src="%{bootstrapJs}"/>
+ <script src="<s:webjar path='jquery/jquery.min.js'/>"></script>
+ <script defer src="<s:webjar
path='bootstrap/js/bootstrap.bundle.min.js'/>"></script>
<s:script>
$(function () {
- var alerts = $('ul.alert').wrap('<div />');
- alerts.prepend('<a class="close" data-dismiss="alert"
href="#">×</a>');
- alerts.alert();
+ $('ul.alert').each(function () {
+ var wrapper = $('<div class="alert alert-dismissible" />');
+ $(this).before(wrapper);
+ wrapper.append('<button type="button" class="btn-close"
data-bs-dismiss="alert" aria-label="Close"></button>').append(this);
+ });
Review Comment:
The alert “dismiss” wrapper creates a nested `.alert` element and drops the
original alert-variant class (e.g., `alert-danger`) onto the inner `<ul>`,
which can break Bootstrap 5 styling/spacing and close-button positioning.
Prefer moving the existing `ul.alert` classes onto the wrapper and stripping
`.alert*` from the `<ul>` so the wrapper is the actual alert container.
##########
apps/rest-showcase/src/main/webapp/WEB-INF/content/orders-edit.jsp:
##########
@@ -44,47 +45,47 @@
<div class="row">
<div class="col-md-12">
- <div class="page-header">
+ <div class="border-bottom pb-2">
<h1>Order <s:property value="id" /></h1>
</div>
<s:actionmessage cssClass="alert alert-danger"/>
- <s:form method="post"
action="%{#request.contextPath}/orders/%{id}" cssClass="form-horizontal"
theme="simple">
+ <s:form method="post"
action="%{#request.contextPath}/orders/%{id}" theme="simple">
<s:hidden name="_method" value="put" />
- <div class="form-group">
- <label class="col-sm-2 control-label" for="id">ID</label>
+ <div class="row mb-3">
+ <label class="col-sm-2 col-form-label" for="id">ID</label>
<div class="col-sm-4">
<s:textfield id="id" name="id" disabled="true"
cssClass="form-control"/>
</div>
</div>
- <div class="form-group">
- <label class="col-sm-2 control-label"
for="clientName">Client</label>
+ <div class="row mb-3">
+ <label class="col-sm-2 col-form-label"
for="clientName">Client</label>
<div class="col-sm-4">
<s:textfield id="clientName" name="clientName"
cssClass="form-control"/>
</div>
<div class="col-sm-4">
<s:fielderror fieldName="clientName" />
</div>
</div>
- <div class="form-group">
- <label class="col-sm-2 control-label"
for="amount">Amount</label>
+ <div class="row mb-3">
+ <label class="col-sm-2 col-form-label"
for="amount">Amount</label>
<div class="col-sm-4">
<s:textfield id="amount" name="amount"
cssClass="form-control" />
</div>
<div class="col-sm-4">
<s:fielderror fieldName="amount" />
</div>
</div>
- <div class="form-group">
- <div class="col-sm-offset-2 col-sm-4">
+ <div class="row mb-3">
+ <div class="offset-sm-2 col-sm-4">
<s:submit cssClass="btn btn-primary"/>
</div>
</div>
<table>
</s:form>
Review Comment:
There is a stray `<table>` start tag immediately before `</s:form>` with no
corresponding content or closing tag, which makes the rendered HTML invalid.
Issue Time Tracking
-------------------
Worklog Id: (was: 1031150)
Time Spent: 50m (was: 40m)
> Upgrade bundled Bootstrap in sample apps from 3.3.4 to 5.3.x
> ------------------------------------------------------------
>
> Key: WW-5653
> URL: https://issues.apache.org/jira/browse/WW-5653
> Project: Struts 2
> Issue Type: Improvement
> Components: Example Applications
> Reporter: Lukasz Lenart
> Assignee: Lukasz Lenart
> Priority: Major
> Fix For: 7.3.0
>
> Time Spent: 50m
> Remaining Estimate: 0h
>
> h2. Summary
> Upgrade the bundled Bootstrap in the sample applications from the current
> *3.3.4* to the latest *5.3.x* release. Bootstrap 3.3.4 (released 2015) is
> long out of support, ships known-vulnerable assets, and predates the removal
> of the jQuery dependency in Bootstrap 5.
> h2. Current State
> * {{apps/showcase}} bundles static Bootstrap 3.3.4 assets:
> ** {{src/main/webapp/styles/bootstrap*.css}} (+ {{bootstrap-theme}})
> ** {{src/main/webapp/js/bootstrap.min.js}}
> * {{apps/rest-showcase}} bundles the same static Bootstrap 3.3.4 CSS under
> {{src/main/webapp/css/}}.
> * Assets are checked into the repo and loaded via {{<s:link>}} /
> {{<s:script>}} in the decorators (e.g.
> {{apps/showcase/src/main/webapp/WEB-INF/decorators/main.jsp}}).
> * Roughly *78 JSP files* in {{apps/showcase}} depend on Bootstrap 3 markup
> (glyphicons, {{panel-*}}, {{navbar-*}}, {{col-xs-*}}, {{btn-*}} conventions).
> h2. Motivation
> * Bootstrap 3.3.4 is unsupported and carries known XSS advisories fixed in
> later releases.
> * Bootstrap 5 *removes the jQuery dependency entirely*, which unblocks and
> simplifies the separate effort to migrate the sample apps to the framework's
> {{<s:webjar>}} support.
> * Keeps the showcase — the framework's public demo app — on a current,
> maintained UI toolkit.
> h2. Scope of Work
> # Replace bundled Bootstrap 3.3.4 assets with Bootstrap 5.3.x in
> {{apps/showcase}} and {{apps/rest-showcase}}.
> # Migrate Bootstrap 3 markup to Bootstrap 5 across all affected JSPs:
> #* {{glyphicon}} icons are removed in BS4+ — replace with an alternative
> (e.g. Bootstrap Icons, or inline SVG).
> #* {{panel-*}} → {{card-*}}.
> #* {{navbar}} markup and toggle behavior rewritten in BS5.
> #* Grid changes ({{col-xs-*}} removed, {{col-*}} breakpoints reworked).
> #* {{data-*}} JS hooks now namespaced as {{data-bs-*}}.
> # Update the decorators to drop the jQuery {{<s:script>}} include where it
> existed only to satisfy Bootstrap (Bootstrap 5 needs no jQuery). Retain
> jQuery only where the sample pages use it directly.
> # Verify all showcase pages render and interactive components (dropdowns,
> modals, collapses, tooltips) work in a real browser.
> h2. Risks / Notes
> * This is a *breaking UI migration*, not a version bump — BS3 → BS5 has no
> drop-in compatibility path. Expect changes in most showcase JSPs.
> * Coordinate with the "migrate showcase to {{<s:webjar>}} support" effort —
> dropping jQuery here changes that ticket's calculus.
> * Consider whether Bootstrap assets should be pulled via WebJars as part of
> this work rather than re-bundling static files.
> h2. Acceptance Criteria
> * No Bootstrap 3.x assets remain in {{apps/showcase}} or
> {{apps/rest-showcase}}.
> * All showcase and rest-showcase pages render correctly with Bootstrap 5.3.x.
> * Interactive Bootstrap components function without jQuery.
> * Build passes ({{mvn clean install -DskipAssembly}}) and the apps deploy and
> run.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)