Skip to content

Commit bc64c4c

Browse files
committed
Merge pull request #382 from mhurne/2.2.x
Fix for GRAILS-10291 "Method name must not be null" exception when using...
2 parents 820f9a7 + 53b901f commit bc64c4c

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

grails-plugin-controllers/src/main/groovy/org/codehaus/groovy/grails/web/metaclass/ForwardMethod.groovy

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ import org.springframework.context.ApplicationContext
3232
*/
3333
class ForwardMethod {
3434

35+
public static final String IN_PROGRESS = "org.codehaus.groovy.grails.FORWARD_IN_PROGRESS"
3536
public static final String CALLED = "org.codehaus.groovy.grails.FORWARD_CALLED"
3637

3738
private UrlConverter urlConverter
@@ -51,6 +52,7 @@ class ForwardMethod {
5152
BeanUtils.populate(urlInfo, params)
5253

5354
def model = params.model instanceof Map ? params.model : Collections.EMPTY_MAP
55+
request.setAttribute(IN_PROGRESS, true)
5456
String uri = WebUtils.forwardRequestForUrlMappingInfo(request, response, urlInfo, model, true)
5557
request.setAttribute(CALLED, true)
5658
return uri

grails-web/src/main/groovy/org/codehaus/groovy/grails/web/servlet/mvc/AbstractGrailsControllerHelper.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ public abstract class AbstractGrailsControllerHelper implements ApplicationConte
7272

7373
private static final Log LOG = LogFactory.getLog(AbstractGrailsControllerHelper.class);
7474
private static final String PROPERTY_CHAIN_MODEL = "chainModel";
75+
private static final String FORWARD_IN_PROGRESS = "org.codehaus.groovy.grails.FORWARD_IN_PROGRESS";
7576
private static final String FORWARD_CALLED = "org.codehaus.groovy.grails.FORWARD_CALLED";
7677

7778
public ServletContext getServletContext() {
@@ -134,7 +135,7 @@ public ModelAndView handleURI(final String originalUri, GrailsWebRequest grailsW
134135

135136
// Step 2: lookup the controller in the application.
136137
GrailsControllerClass controllerClass=null;
137-
if(!WebUtils.isIncludeRequest(request)) {
138+
if (!WebUtils.isIncludeRequest(request) && request.getAttribute(FORWARD_IN_PROGRESS) == null) {
138139

139140
Object attribute = grailsWebRequest.getAttribute(GrailsApplicationAttributes.GRAILS_CONTROLLER_CLASS, WebRequest.SCOPE_REQUEST);
140141
if (attribute instanceof GrailsControllerClass) {

0 commit comments

Comments
 (0)