2012-02-27 83 views
0

ismy控制器不工作,我不为什么在这里理解是:Grails的重定向不工作

class FormmakerController { 

def fileManipulatorService 

def index = { } 

def idProcessor = { 
    String idToProcess = params.urlEncParam 

    //Params lookalike urlEncParam:301-303-304-305 
    if(idToProcess != null){ 
     String globalForm = '' 
     idToProcess.split('-').each {item-> 
      globalForm += fileManipulatorService.fileProvider(item).getText() 
     } 

     //render(text: globalForm, contentType: "text/xml", encoding: "ISO-8859-1") 

     //response.sendError(200) 
     redirect(controller: 'tools', action: 'index', params: [globalForm: String]) 
    }}} 

注:控制器从一个Ajax请求打来电话,我的重定向指令需要调用一个动作与文本参数不同的控制器。 感谢您的帮助。

+0

什么版本的Grails? – 2012-02-27 17:53:39

+0

另外,这是如何从另一个控制器调用? – 2012-02-27 18:23:13

+0

@Colin我正在使用的版本是Grails 1.3.7 – Smithfield 2012-02-28 11:57:12

回答

0

重定向的参数看起来不正确。试试:

redirect(controller: 'tools', action: 'index', params: [globalForm: globalForm])