Grails按钮不执行我的操作?

Grails按钮不执行我的操作?,grails,button,action,execute,Grails,Button,Action,Execute,我的查看页面中有此按钮 <a class="runimg" href="${createLink(controller: 'Ec2Controller', action: 'Start', id: i.Id)}">&nbsp;Start&nbsp;</a> 您在重定向中调用了方法索引: redirect action: index() 应该是 redirect action: 'index' 除了@Sérgio所说的之外,除非您的控制器名为Ec2Co

我的查看页面中有此按钮

<a class="runimg" href="${createLink(controller: 'Ec2Controller', action: 'Start', id: i.Id)}">&nbsp;Start&nbsp;</a>

您在重定向中调用了方法索引:

redirect action: index()
应该是

redirect action: 'index'

除了@Sérgio所说的之外,除非您的控制器名为
Ec2ControllerController
,否则您的控制器名是错误的。它应该是
Ec2

以前已经尝试过了,但它一直在引导我到我很困惑的地方。您的链接指向
Ec2Controller
,但您提到的这个链接指向amazonEc2。这个动作的名字是startServer而不是Start?@TestUser我想你在这里得到了答案,我在你的问题中作为评论提到过。发布完整的控制器谢谢,这确实是问题所在
redirect action: 'index'