grails重定向中的异常

时间:2012-10-03 13:53:56

标签: grails

您好我正在尝试使用redirect(uri: "/errors/handle500")重定向,但我收到以下异常

Cannot issue a redirect(..) here. A previous call to redirect(..) has already redirected the response.. Stacktrace follows:
  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.cisco.rms.ErrorsController$_closure1.doCall(ErrorsController.groovy:8)
2012-10-03 18:05:53,414 [http-bio-8080-exec-7] ERROR errors.GrailsExceptionResolver  - CannotRedirectException occurred when processing request: [GET] /rmsportal/changeRequest/listJSONFromService 

任何人都可以告诉我它为什么不重定向。

1 个答案:

答案 0 :(得分:0)

tim_yates是对的,你不能调用第二个重定向。也许您想要使用forward,并记住单独的重定向不会阻止grails执行其余的控制器代码。