Skip to content

Reply 400 or 404 to a system or group detail page without a valid ID - #59

Merged
slominskir merged 1 commit into
mainfrom
fix/detail-missing-id
Oct 28, 2026
Merged

slominskir merged 1 commit into
mainfrom
fix/detail-missing-id

Conversation

@slominskir-coding-agent

Copy link
Copy Markdown
Contributor

Fixes #51

What changed

/system-detail and /group-detail replied 500 (and logged EJBException: IllegalArgumentException: id to load is required for loading) when their ID was missing or empty, and the same for a non-number ID (NumberFormatException in ParamConverter). An ID that matched nothing rendered an empty page with a 200.

SystemDetail and GroupDetail now reply, through the app's /error page:

Request Before After
no ID, empty ID, abc 500 400
unknown ID (999999) 200, empty page 404
valid ID 200 200

PagesIT gets detailPageRejectsMissingOrUnknownId, covering those eight URLs.

No schema or settings changes, so there are no upgrade steps.

Checks

  • ./gradlew build (compile + spotlessCheck): passed.
  • New PagesIT cases against the unfixed app: all 8 failed (500 and 200, as above).
  • My build ran as a side container (port 18443) on the dev stack's Oracle and Keycloak. ./gradlew integrationTest passed in full (all 41 PagesIT cases, plus MaskingRequestIT, ReadinessIT and StatusReportsIT).
  • Server log: none of the requests above logged an ERROR. The only ERROR lines came from MaskingRequestIT's existing access-denied checks.
  • Looked at screenshots taken with Puppet Show: group-detail?groupId=999999 shows the error page with "404: Not Found", and system-detail?systemId=141 still renders as before.
  • CI's build doesn't run the integration tests; they need the running stack.

Decisions

  • A non-number ID is treated like a missing one (400), following Checklists, which catches ParamConverter's exception and replies 400.
  • sendError has no message: the app's error page shows only the status, so the other servlets don't pass one either.
  • An unknown ID gets a 404 rather than the page's "not found" text, since the JSPs have no not-found state and the error page already shows "404: Not Found".

Prepared-by: Anthropic Claude Code:claude-opus-5-5

🤖 Generated with Claude Code

/system-detail and /group-detail replied 500 and logged an
EJBException when their ID parameter was missing, empty or not a
number, since the null ID went straight to EntityManager.find (or
ParamConverter threw NumberFormatException). An ID that matched nothing
rendered an empty page with a 200.

Reply 400 for a missing, empty or non-number ID, and 404 when no system
or group has the ID, through the app's error page. PagesIT checks both
pages for each case.

Fixes #51

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@slominskir
slominskir merged commit 58336ef into main Oct 28, 2026
5 checks passed
@slominskir
slominskir deleted the fix/detail-missing-id branch October 28, 2026 19:31
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.

system-detail and group-detail return 500 without an ID

1 participant