diff --git a/grails-plugin-controllers/src/main/groovy/org/codehaus/groovy/grails/web/metaclass/ForwardMethod.groovy b/grails-plugin-controllers/src/main/groovy/org/codehaus/groovy/grails/web/metaclass/ForwardMethod.groovy index c52927de4f2..83cb7faf088 100644 --- a/grails-plugin-controllers/src/main/groovy/org/codehaus/groovy/grails/web/metaclass/ForwardMethod.groovy +++ b/grails-plugin-controllers/src/main/groovy/org/codehaus/groovy/grails/web/metaclass/ForwardMethod.groovy @@ -32,6 +32,7 @@ import org.springframework.context.ApplicationContext */ class ForwardMethod { + public static final String IN_PROGRESS = "org.codehaus.groovy.grails.FORWARD_IN_PROGRESS" public static final String CALLED = "org.codehaus.groovy.grails.FORWARD_CALLED" private UrlConverter urlConverter @@ -51,6 +52,7 @@ class ForwardMethod { BeanUtils.populate(urlInfo, params) def model = params.model instanceof Map ? params.model : Collections.EMPTY_MAP + request.setAttribute(IN_PROGRESS, true) String uri = WebUtils.forwardRequestForUrlMappingInfo(request, response, urlInfo, model, true) request.setAttribute(CALLED, true) return uri diff --git a/grails-web/src/main/groovy/org/codehaus/groovy/grails/web/servlet/mvc/AbstractGrailsControllerHelper.java b/grails-web/src/main/groovy/org/codehaus/groovy/grails/web/servlet/mvc/AbstractGrailsControllerHelper.java index 1c82d33be2c..c6151c6d0d5 100644 --- a/grails-web/src/main/groovy/org/codehaus/groovy/grails/web/servlet/mvc/AbstractGrailsControllerHelper.java +++ b/grails-web/src/main/groovy/org/codehaus/groovy/grails/web/servlet/mvc/AbstractGrailsControllerHelper.java @@ -72,6 +72,7 @@ public abstract class AbstractGrailsControllerHelper implements ApplicationConte private static final Log LOG = LogFactory.getLog(AbstractGrailsControllerHelper.class); private static final String PROPERTY_CHAIN_MODEL = "chainModel"; + private static final String FORWARD_IN_PROGRESS = "org.codehaus.groovy.grails.FORWARD_IN_PROGRESS"; private static final String FORWARD_CALLED = "org.codehaus.groovy.grails.FORWARD_CALLED"; public ServletContext getServletContext() { @@ -134,7 +135,7 @@ public ModelAndView handleURI(final String originalUri, GrailsWebRequest grailsW // Step 2: lookup the controller in the application. GrailsControllerClass controllerClass=null; - if(!WebUtils.isIncludeRequest(request)) { + if (!WebUtils.isIncludeRequest(request) && request.getAttribute(FORWARD_IN_PROGRESS) == null) { Object attribute = grailsWebRequest.getAttribute(GrailsApplicationAttributes.GRAILS_CONTROLLER_CLASS, WebRequest.SCOPE_REQUEST); if (attribute instanceof GrailsControllerClass) {