codeconsole commented on PR #16184:
URL: https://github.com/apache/grails-core/pull/16184#issuecomment-5667872169

   @matrei Fixed in 5f11919ad4.
   
   Reproduced with `Accept: text/html` on an unmapped path: Tomcat's 404 page, 
and `Circular view path [error]` in the log.
   
   **Fix.** `GspAutoConfiguration` now contributes a 
`StandaloneGroovyPageViewResolver` whose `createJstlView` returns `null` unless 
`servletContext.getResource` finds the JSP, so `error` falls through to 
`BeanNameViewResolver` and the whitelabel page. The check is kept out of the 
shared `GroovyPageViewResolver`: `GroovyPagesGrailsPlugin` turns the same 
fallback on for every Grails application with JSTL present, and a Grails 
application never reaches this path, so its fallback is left as it was. A JSP 
that exists resolves as before, so `form.jsp` is still decorated by its layout 
(`JspViewTest` passes).
   
   **Tests.** `ErrorPageTest` in the example: `GET /does-not-exist` with 
`Accept: text/html` is a 404 whose body is the whitelabel page. 
`StandaloneGroovyPageViewResolverSpec` covers both branches through 
`resolveViewName`. Both fail with the check reverted.
   
   **Docs.** The guide page's configuration table lists `spring.gsp.jspEnabled` 
and what it now does.
   
   Per-status GSP error pages through a `TemplateAvailabilityProvider` are left 
out of this PR, as suggested.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to