Skip to content

WW-5782 fix(tags): document and warn that s:a href ignores nested params - #2034

Merged
lukaszlenart merged 1 commit into
mainfrom
WW-5782-anchor-href-params
Oct 16, 2026
Merged

lukaszlenart merged 1 commit into
mainfrom
WW-5782-anchor-href-params

Conversation

@lukaszlenart

Copy link
Copy Markdown
Member

Fixes WW-5782

Summary

With an explicit href, <s:a> never applies nested <s:param> tags — they are only used when the URL is built from value/action. The tag's own javadoc example showed exactly that combination:

Tag Rendered
<s:a href="/do-it.action"> + <s:param name="id" value="1"/> <a href="/do-it.action"></a>
<s:a value="/do-it.action"> + <s:param name="id" value="1"/> <a href="/do-it.action?id=1"></a>

This PR keeps the rendered output unchanged and stops hiding the behaviour:

  • the javadoc example uses value, and the javadoc says nested params are ignored with href
  • the href attribute description says so too (a-attributes.html regenerated by the compile — only that line changed)
  • in devMode, the tag logs a warning naming the ignored params; nothing is logged outside devMode, so production logs stay quiet

Applying nested params to an explicit href changes what existing pages render, so it is parked for 8.0.0 as WW-5783, next to the related WW-3571.

Tests

AnchorTagTest:

  • href + nested param renders only the href and logs nothing (devMode off)
  • same with devMode on logs one warning naming [id] — failed before the change
  • value + nested param still appends the param and logs nothing

./mvnw test -DskipAssembly -pl core: 3483 tests, 0 failures.

🤖 Generated with Claude Code

With an explicit href the anchor tag never applies nested <s:param> tags;
they are only used when the URL is built from value or action. The javadoc
example showed exactly that combination.

The example now uses value, the javadoc and the href attribute description
say nested params are not applied to href, and in devMode the tag logs a
warning naming the ignored params. Rendered output is unchanged; applying
params to href is WW-5783 (8.0.0).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@lukaszlenart
lukaszlenart marked this pull request as ready for review October 16, 2026 09:30
@sonarqubecloud

Copy link
Copy Markdown

@lukaszlenart
lukaszlenart merged commit 76d6b14 into main Oct 16, 2026
8 checks passed
@lukaszlenart
lukaszlenart deleted the WW-5782-anchor-href-params branch October 16, 2026 10:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant