Skip to content

Fix javax.servlet.error.exception in generated error.gsp templates (7.0.x) - #16380

Merged
jdaugherty merged 1 commit into
7.0.xfrom
fix/error-gsp-jakarta-servlet-attribute-7.0.x
Sep 23, 2026
Merged

jdaugherty merged 1 commit into
7.0.xfrom
fix/error-gsp-jakarta-servlet-attribute-7.0.x

Conversation

@sbglasius

Copy link
Copy Markdown
Contributor

Summary

Backport of #16379 to 7.0.x.

  • The Grails Forge and web application profile error.gsp templates still looked up the pre-Jakarta EE attribute javax.servlet.error.exception. Since 7.0.x already targets Jakarta EE (jakarta.servlet-api), the lookup never matched and the branch that renders exception details in development mode never fired.
  • Changed both templates to use jakarta.servlet.error.exception (jakarta.servlet.RequestDispatcher.ERROR_EXCEPTION), matching the container-set attribute name.
  • Added a test asserting the generated error page uses the jakarta attribute.

Reported on the mailing list; tracked in #16378.

Test plan

  • ./gradlew :grails-forge-core:test --tests "org.grails.forge.feature.view.GrailsGspSpec" — all 10 tests pass

The Grails Forge and web profile error.gsp templates still looked up
the pre-Jakarta EE attribute javax.servlet.error.exception. Since
this branch already targets Jakarta EE (jakarta.servlet-api), the
container stores the forwarded exception under
jakarta.servlet.error.exception
(jakarta.servlet.RequestDispatcher.ERROR_EXCEPTION), so the lookup
never matched and the elseif branch that renders exception details
never fired.

Backport of e1ec262 from 8.0.x.

Fixes #16378

@matrei matrei left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the backport! I compared this with #16379. The template changes to the forge gsp/error.gsp and the web profile skeleton error.gsp are identical to the 8.0.x PR, and the new GrailsGspSpec feature is the same too. After this change the two templates are byte-identical on 7.0.x.

The only differences from #16379 look expected:

  • The "gsp/error.gsp" entry in the forge/profile-skeleton byte-identity check is left out. That check doesn't exist on 7.0.x, so there's nothing to add it to.
  • A trailing-whitespace cleanup on a blank line in test default views are present. Harmless.

A non-blocking note: the same javax.servlet.error.exception lookup is still in several error.gsp files under grails-test-examples/ (geb, geb-gebconfig, hibernate5/issue450, mail, scaffolding) and grails-data-neo4j/examples/. They aren't user-facing templates, so they don't need to block this PR, but they're copies of the old template and could be updated in a follow-up (on both branches) for consistency.

LGTM 👍

@testlens-app

testlens-app Bot commented Sep 23, 2026

Copy link
Copy Markdown

✅ All tests passed ✅

🏷️ Commit: 216f786
▶️ Tests: 49743 executed
⚪️ Checks: 51/51 completed


Learn more about TestLens at testlens.app/docs.

@jdaugherty
jdaugherty merged commit 86824f6 into 7.0.x Sep 23, 2026
52 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants