Grails - 先前的重定向呼叫(..)已重定向 [英] Grails - A previous call to redirect(..) has already redirected
问题描述
$ b 2011-04-27 12:18:40,469 [TP-Processor13]错误GrailsExceptionResolver - 在这里不能发出重定向(..)。之前调用重定向(..)已经重定向了响应。
org.codehaus.groovy.grails.web.servlet.mvc.exceptions.CannotRedirectException:无法在此处发出重定向(..)。之前调用重定向(..)已经重定向了响应。
在com.coach.LoginController $ _closure2.doCall(LoginController.groovy:90)
...
不知道如何跟踪这个。任何想法或建议?
Todd
检查登录控制器;好像你没有从重定向后的动作中返回。 ::
if(some condition){
redirect()
return //应该从这里返回来完成动作,否则其余的代码将被执行
}
In Grails app, occasionally seeing "Cannot issue redirect" in logs:
2011-04-27 12:18:40,469 [TP-Processor13] ERROR GrailsExceptionResolver - Cannot issue a redirect(..) here. A previous call to redirect(..) has already redirected the response. org.codehaus.groovy.grails.web.servlet.mvc.exceptions.CannotRedirectException: Cannot issue a redirect(..) here. A previous call to redirect(..) has already redirected the response. at com.coach.LoginController$_closure2.doCall(LoginController.groovy:90) ...
Not sure how to track this down. Any ideas or suggestions?
Todd
Check the login controller; it seems like you are not returning from the action after redirect. E.g.:
if (some condition) {
redirect ()
return // should return from here to finish the action, otherwise the rest of the code will be executed
}
这篇关于Grails - 先前的重定向呼叫(..)已重定向的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!