Keep the URL fragment in UrlRenderer#renderFullUrl

Open
#1,950 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@Mr-KnightCLI is already working on this.

Since Nov 19, 2026.

  • #1961 by @Mr-KnightCLI — open
  • #1967 by @guru-bharadwaj20 — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
35/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
java
Domain
backend

Research direction

Read wicket-request/src/main/java/org/apache/wicket/request/UrlRenderer.java, comparing renderFullUrl(Url) with the fragment handling at the end of renderRelativeUrl. Add coverage in wicket-core-tests/src/test/java/org/apache/wicket/core/request/cycle/UrlRendererTest.java for full, context-absolute and relative inputs; install wicket-request before running those tests. Done means all three forms retain their URL fragment.

Written by the indexing model from the issue text.

Description

good first issue

UrlRenderer#renderRelativeUrl keeps a URL's fragment (the part after #), but UrlRenderer#renderFullUrl drops it. A link rendered as a full URL, for example https://example.com/app/page#section, loses its #section. Both methods should produce the same URL, the full one just written as an absolute URL.

Where

wicket-request/src/main/java/org/apache/wicket/request/UrlRenderer.java, method renderFullUrl(Url). It builds the result from protocol, host, port, context path and path, and never looks at url.getFragment(). Compare with the end of renderRelativeUrl, which calls relativeUrl.setFragment(url.getFragment()).

Done when

  • renderFullUrl keeps the fragment, for full, context-absolute and relative input URLs.
  • Tests in wicket-core-tests/src/test/java/org/apache/wicket/core/request/cycle/UrlRendererTest.java. The tests live in a different module than the code: install wicket-request before running them, or the test runs against the last jar you installed.

Background

Originally reported as WICKET-7165 (Wicket 10.6).


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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from apache/wicket

All issues in apache/wicket

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.