Skip to content

Commit 09bd010

Browse files
committed
fix for GRAILS-6100 "Unable to display a specific view with an additional HandlerExceptionResolver"
1 parent 8d5d470 commit 09bd010

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/java/org/codehaus/groovy/grails/web/servlet/GrailsDispatcherServlet.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ public Locale getLocale() {
210210
Exception handlerException = null;
211211
try {
212212
ModelAndView mv;
213+
boolean errorView = false;
213214
try {
214215
Object exceptionAttribute = request.getAttribute(EXCEPTION_ATTRIBUTE);
215216
// only process multipart requests if an exception hasn't occured
@@ -279,6 +280,7 @@ public Locale getLocale() {
279280
handlerException = ex;
280281
Object handler = (mappedHandler != null ? mappedHandler.getHandler() : null);
281282
mv = processHandlerException(request, response, handler, ex);
283+
errorView = (mv != null);
282284
}
283285

284286
// Did the handler return a view to render?
@@ -288,6 +290,9 @@ public Locale getLocale() {
288290

289291
try {
290292
render(mv, processedRequest, response);
293+
if (errorView) {
294+
WebUtils.clearErrorRequestAttributes(request);
295+
}
291296
} catch (Exception e) {
292297
// Only render the error view if we're not already trying to render it.
293298
// This prevents a recursion if the error page itself has errors.

0 commit comments

Comments
 (0)