Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.2.2
-
Component/s: View technologies
-
Labels:None
-
Patch Submitted:Yes
Description
When an additional HandlerExceptionResolver process an exception and returns a model and view , the default error view is displaed instead.
This happens because, in class GrailsDispatcherServlet, the following method isn't called:
> WebUtils.clearErrorRequestAttributes(request);
This method is called in parent class DispatcherServlet, but any more in GrailsDispatcherServlet.
See the patch for further informations.
-
- GrailsDispatcherServlet.java.patch
- 26/Mar/10 10:23 PM
- 1 kB
- boillod manuel
-
Hide
- TestDispatcher.zip
- 25/Jul/10 7:24 PM
- 190 kB
- boillod manuel
-
- TestDispatcher/.classpath 0.8 kB
- TestDispatcher/.project 0.7 kB
- TestDispatcher/.../com.springsource.sts.grails.core.prefs 1 kB
- TestDispatcher/.../org.codehaus.groovy.eclipse.preferences.prefs 0.1 kB
- TestDispatcher/application.properties 0.2 kB
- TestDispatcher/.../BootStrap.groovy 0.1 kB
- TestDispatcher/.../BuildConfig.groovy 1 kB
- TestDispatcher/grails-app/.../Config.groovy 3 kB
- TestDispatcher/.../DataSource.groovy 0.6 kB
- TestDispatcher/.../UrlMappings.groovy 0.2 kB
- TestDispatcher/.../resources.groovy 0.2 kB
- TestDispatcher/.../TestDispatcherController.groovy 0.4 kB
- TestDispatcher/.../messages.properties 3 kB
- TestDispatcher/.../messages_da.properties 3 kB
- TestDispatcher/.../messages_de.properties 4 kB
- TestDispatcher/.../messages_es.properties 3 kB
- TestDispatcher/.../messages_fr.properties 2 kB
- TestDispatcher/.../messages_it.properties 2 kB
- TestDispatcher/.../messages_ja.properties 2 kB
- TestDispatcher/.../messages_nl.properties 3 kB
- TestDispatcher/.../messages_pt_BR.properties 3 kB
- TestDispatcher/.../messages_pt_PT.properties 3 kB
- TestDispatcher/.../messages_ru.properties 4 kB
- TestDispatcher/.../messages_th.properties 5 kB
- TestDispatcher/.../messages_zh_CN.properties 2 kB
- TestDispatcher/grails-app/.../error.gsp 2 kB
- TestDispatcher/.../illegalArgumentView.gsp 0.1 kB
- TestDispatcher/.../illegalArgumentViewLayout.gsp 0.2 kB
- TestDispatcher/grails-app/.../index.gsp 3 kB
- TestDispatcher/grails-app/.../main.gsp 0.7 kB
Activity
- All
- Comments
- Work Log
- History
- Activity
- Git Commits
With difficult, I've reproduce the bug in a simple project : TestDispatcher.zip (joined).
The bug appears only if the GSP use a sitemesh layout !
How to reproduce the bug (Grails 1.3.1)
- Run the project
- Go to URL : http://localhost:8080/TestDispatcher/testDispatcher/index
- Use the link "Runtime Exception" to use default error view [OK]
- Use the link "RedirectViewException("/illegalArgumentViewLayout")" to be redirect to specific view [OK]
- Use the link "RedirectViewException("/illegalArgumentView")" to be redirect to specific view with layout [ERROR]
Why the bug appears only in a GSP with a layout :
Debug with a layout ->
Use decorator : GrailsNoDecorator [GrailsPageFilter.doFilter.143]
Commit the http response during flush [GrailsNoDecorator.render.44]
Because the response is committed, the status of the response is not set by the instruction :
response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); [StandardHostValve.throwable.282]
Debug Without a layout ->
Use decorator : OldDecorator2NewDecorator : org.codehaus.groovy.grails.web.sitemesh.GrailsPageFilter$1$1 [GrailsPageFilter.doFilter.143]
The status of the response is set by the instruction :
response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); [StandardHostValve.throwable.282]
With the patch, everything is ok.
Fixed 1.3.x: http://github.com/grails/grails-core/commit/692f7afbf92caa5dbe31678e46d439ab7d1d2da9
Fixed 1.2.x: http://github.com/grails/grails-core/commit/09bd01001424627b052cc61b36ed9f6e9f4b645c
Thanks for the patch
It would help if you could attach an example that reproduces the issue so that I can verify the patch