Welcome page displays layer from wrong workspace when layer names collide

Hi everyone,

I noticed an issue on the GeoServer Welcome Page (/web/) when different workspaces contain layers with identical local names (multi-tenant setup):

Steps to reproduce:

  1. Have two workspaces (e.g. “workspaceA” and “workspaceB”).
  2. Create a layer with the same local name (e.g. “dop_2025”) in both workspaces.
  3. On the Welcome Page (/web/), select “dop_2025” under “workspaceA” in the left sidebar tree.
  4. The page opens with URL: ?workspace=workspaceA&layer=dop_2025

Issue:
While the sidebar and breadcrumb show “workspaceA”, the page content, abstract, and administrative action links (“Edit Layer”, “Edit Store”, “Workspace REST API”) point to “workspaceB:dop_2025”.

Technical cause:
The page receives both “workspace” and “layer” parameters, but appears to perform an unqualified catalog lookup:
catalog.getLayerByName(layerName)
instead of scoping it to the workspace:
catalog.getLayerByName(workspace, layerName)

Because the name is unqualified, it returns the first global match from the catalog. Manually qualifying the URL (&layer=workspaceA:dop_2025) resolves the correct layer.

Could this be tracked in Jira?

Thanks!