Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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) {
Expand Down