Repository navigation
Fix javax.servlet.error.exception in generated error.gsp templates (7.0.x) - #16380
Conversation
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
left a comment
There was a problem hiding this comment.
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 👍
✅ All tests passed ✅🏷️ Commit: 216f786 Learn more about TestLens at testlens.app/docs. |
Summary
Backport of #16379 to
7.0.x.webapplication profileerror.gsptemplates still looked up the pre-Jakarta EE attributejavax.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.jakarta.servlet.error.exception(jakarta.servlet.RequestDispatcher.ERROR_EXCEPTION), matching the container-set attribute name.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