Rewrite srcset attributes inside wicket:link
Maintainers usually reply within 1 day
@aryankalantri is already working on this.
Since Nov 21, 2026.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 82/100
Research direction
Read RelativePathPrefixHandler.java, especially the attributeNames array and its use, then check the auto-link resolver for how src is handled. Add coverage beside the existing tests in RelativePathPrefixHandlerTest.java for srcset on img and source. Done means relative URLs are rewritten while each descriptor is preserved.
Written by the indexing model from the issue text.
Description
Inside <wicket:link> (and for relative paths in general), Wicket rewrites the URLs in href, src and background attributes so they resolve relative to the page's package. The srcset attribute of <img> and <source> is not rewritten, so responsive images in static markup break.
Where
wicket-core/src/main/java/org/apache/wicket/markup/parser/filter/RelativePathPrefixHandler.java, the attributeNames array and the code that uses it. Check also how <wicket:link> resolves src (the auto-link resolver) to see whether srcset needs handling there too.
srcset is not a single URL but a comma-separated list of url descriptor pairs, for example small.jpg 480w, large.jpg 1080w. Each URL needs rewriting and the descriptors must be kept.
Done when
- Relative URLs in
srcseton<img>and<source>are rewritten the same way assrc, with the descriptors kept. - Tests next to the existing ones in
wicket-core-tests/src/test/java/org/apache/wicket/markup/parser/RelativePathPrefixHandlerTest.java.
Background
Originally reported as WICKET-6326 (Wicket 8.0).
Part of #1945. This issue is meant for a first contribution to Wicket. To work on it, leave a comment so others know; a claim without a pull request lapses after two weeks. Questions are welcome, here on the issue or on [email protected]. Start your branch from master, and see Send a pull request to Wicket for building and testing.
- Dominant language
- Java
- Stars
- 800
- Forks
- 437
- Avg merge
- 21h 36m
- Merged PRs (30d)
- 167
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from apache/wicket
-
PropertyResolver fails on JDK classes with a non-public field named like the propertyPossibly taken @vaibhavgupta443 claimed this today. Opengood first issue
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
apache/wicket#1991 · 1 comment ·
Maintainers usually reply within 1 day
-
Stop the autocomplete from accumulating request parameters while typingPossibly taken @aryankalantri claimed this today. Opengood first issue
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
apache/wicket#1947 · 2 comments ·
Maintainers usually reply within 1 day
-
Validate the report-uri value given to CSPHeaderConfiguration#reportBackPossibly taken @AzizOuertani claimed this 3 days ago. Opengood first issue
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
apache/wicket#1946 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 70/100
Maintainers usually reply within 1 day
Similar issues
-
account assessment course feature lecture
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
Maintainers usually reply within 1 day
-
app:learninggoalhub enhancement good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 1/5 1-3 hours Newbie friendliness 86/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100